原创 PIC24数码管显示HELLO

2024-5-30 07:41 215 5 5 分类: MCU/ 嵌入式 文集: PIC
代码:

/* 
 * File:   newmain.c
 * Author: Administrator
 *
 * Created on May 29, 2024, 3:29 PM
 */

#include 
#include 
#include 

#pragma config POSCMOD= XT
#pragma config OSCIOFNC= OFF
#pragma config FCKSM= CSDCMD
#pragma config FNOSC= FRCDIV
#pragma config IESO= ON
#pragma config WDTPS= PS32768
#pragma config FWPSA= PR128
#pragma config WINDIS= OFF
#pragma config FWDTEN= ON
#pragma config ICS= PGx2
#pragma config GWRP= OFF
#pragma config GCP= OFF
#pragma config JTAGEN= OFF
/*
 * 
 */
#define SHORT_DELAY 10000
#define LONG_DELAY 50000

char bitmap[30]={
    0xff,0x89,0x89,0x89,0x00,0x00,   //H
    0xff,0x86,0x86,0x86,0x00,0x00,
    0xff,0xC7,0xC7,0xC7,0x00,0x00,
    0xff,0xC7,0xC7,0xC7,0x00,0x00,
    0xFF,0xC0,0xC0,0xC0,0x00,0x00
};
void main(void)
{
    int i;
    
	TRISA=0XFF00;
	T1CON=0X8030;
	while(1)
	{
		for(i=0;i<30;i++)
        {
            PORTA=bitmap;
            TMR1=0;
            while(TMR10;
        TMR1=0;
        while(TMR1仿真效果图

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
5
关闭 站长推荐上一条 /3 下一条