单片机32*64点阵显示两排16*16的汉字的程序……

2024-12-26 22:41:49
推荐回答(1个)
回答1:

/*************************************
** Header:
** File Name: 16*16点阵滚动显示汉字
** Author:
** Date:
*************************************/
#include
unsigned char code digittab[]={
0x40,0x04,0x47,0xC2,0x44,0x41,0x44,0x42,0xFE,0x7C,0x40,0x00,0x01,0xF2,0x7D,0x22,
0x49,0x22,0x49,0x22,0x4F,0xFE,0x49,0x22,0x49,0x22,0xFD,0x26,0x41,0xF3,0x00,0x00 /* qiang---竖直向下从左到右 */
};
unsigned char code lie[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned int timecount;
unsigned char cnta;
unsigned char cntb;
unsigned char k,i=0;
void main(void)
{
TMOD=0x01;
TH0=(65536-3000)/256;
TL0=(65536-3000)%6;
TR0=1;
ET0=1;
EA=1;
k=0;
while(1)
{;
}
}
void t0(void) interrupt 1 using 0
{
P0=0x00;
P2=0x00;
TH0=(65536-3000)/256;
TL0=(65536-3000)%6;
P1=lie[k];
k ;
if(k==16) k=0;
l ;
P0=digittab[i];/*此处和字模有关*/
i ;
P2=digittab[i];
i ;
if(i==32)
i=0 ;
}