📄 dot_character_1.c
字号:
#include<AT89X52.H>
unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code digittab[64]={0x00,0x00,0x00,0x00,
0x4c,0x34,0x34,0xdc,0x4e,0x3c,0x44,0x8c,0x00, //欢
0x49,0x7a,0xbc,0xa2,0xfd,0xa4,0xbc,0x80,0x00, //迎
0x88,0x8a,0xfc,0x0f,0xfc,0x8b,0x88,0xc0,0x00, //光
0x38,0xfe,0xe8,0xa6,0xec,0xac,0xf4,0x00,0x00, //临
0x00,0x00,0x00};
#define Anode P2 //接口定义
#define Cathode P0
unsigned int timecount;
unsigned char cnta;
unsigned char n;
void main(void)
{
TMOD=0x01;
TH0=-3000/256; //TH0=-3000>>8;
TL0=-3000%256; //TL0=-3000&0xff;
TR0=1;
ET0=1;
EA=1;
while(1);
}
void to(void) interrupt 1 using 0
{
TH0=-3000/256;
TL0=-3000%256;
Cathode=tab[cnta];
Anode=digittab[cnta+n];
cnta++;
if(cnta==8)
{
cnta=0;
}
timecount++;
if(timecount==50)
{
timecount=0;
n++;
if(n>42)
{
n=0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -