51单片机8×8LED点阵显示数字与字符
unsigned char
unsigned charcode digittab[][8]={
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//" ",0*/
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//" ",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},//"_",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF},//"_",0*/
{0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF},//"_",0*/
{0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF},//"_",0*/
{0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF},//"_",0*/
{0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//"_",0*/
{0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//"_",0*/
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//"_",0*/
{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},//"|",0*/
{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},//"|",0*/
{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},//"|",0*/
{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},//"|",0*/
{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},//"|",0*/
{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},//"|",0*/
{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},//"|",0*/
{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},//"|",0*/
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//" ",0*/
//图形1
{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00},//"未命名文件",0*/
{0x00,0x00,0x3C,0x24,0x24,0x3C,0x00,0x00},//"未命名文件",0*/
{0x00,0x7E,0x42,0x42,0x42,0x42,0x7E,0x00},//"未命名文件",0*/
{0xFF,0x81,0x81,0x81,0x81,0x81,0x81,0xFF},//"未命名文件",0*/
//图形2
{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00},
{0x00,0x00,0x24,0x18,0x18,0x24,0x00,0x00},
{0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00},
{0x81,0x42,0x24,0x18,0x18,0x24,0x42,0x81},
//图形3
{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00},
{0x00,0x00,0x24,0x18,0x18,0x24,0x00,0x00},
{0x00,0x10,0x24,0x1A,0x58,0x24,0x08,0x00},
{0x08,0x10,0x24,0x9A,0x59,0x24,0x08,0x10},
{0x0C,0x10,0xA4,0x9A,0x59,0x25,0x08,0x30},
{0x0E,0x90,0xA4,0x9A,0x59,0x25,0x09,0x70},
{0x8F,0x90,0xA4,0x9A,0x59,0x25,0x09,0xF1},
{0x0C,0x12,0x12,0x12,0x12,0x12,0x0C,0x00},
{0x04,0x06,0x04,0x04,0x04,0x04,0x0E,0x00},
{0x0C,0x12,0x10,0x08,0x04,0x02,0x1E,0x00},
{0x0C,0x12,0x10,0x0C,0x10,0x12,0x0C,0x00},
{0x08,0x0C,0x0C,0x0A,0x0A,0x1E,0x08,0x00},
{0x1E,0x02,0x02,0x0E,0x10,0x10,0x0E,0x00},
{0x0C,0x12,0x02,0x0E,0x12,0x12,0x0C,0x00},
{0x1E,0x12,0x10,0x08,0x04,0x04,0x04,0x00},
{0x0C,0x12,0x12,0x0C,0x12,0x12,0x0C,0x00},
{0x0C,0x12,0x12,0x1C,0x10,0x12,0x0C,0x00},
{0x0C,0x12,0x12,0x12,0x1E,0x12,0x12,0x00},
{0x0E,0x12,0x12,0x0E,0x12,0x12,0x0E,0x00},
{0x0C,0x12,0x02,0x02,0x02,0x12,0x0C,0x00},
{0x0E,0x12,0x12,0x12,0x12,0x12,0x0E,0x00},
{0x1E,0x02,0x02,0x0E,0x02,0x02,0x1E,0x00},
{0x1E,0x02,0x02,0x0E,0x02,0x02,0x02,0x00},
{0x0C,0x12,0x02,0x1A,0x12,0x12,0x0C,0x00},
{0x12,0x12,0x12,0x1E,0x12,0x12,0x12,0x00},
{0x0E,0x04,0x04,0x04,0x04,0x04,0x0E,0x00},
{0x10,0x10,0x10,0x10,0x12,0x12,0x0C,0x00},
{0x12,0x12,0x0A,0x06,0x0A,0x12,0x12,0x00},
{0x02,0x02,0x02,0x02,0x02,0x02,0x1E,0x00},
{0x12,0x1E,0x1E,0x12,0x12,0x12,0x12,0x00},
{0x12,0x16,0x16,0x1A,0x1A,0x12,0x12,0x00},
{0x1E,0x12,0x12,0x12,0x12,0x12,0x1E,0x00},
{0x0E,0x12,0x12,0x0E,0x02,0x02,0x02,0x00},
{0x0C,0x12,0x12,0x12,0x16,0x1A,0x1C,0x00},
{0x0E,0x12,0x12,0x0E,0x06,0x0A,0x12,0x00},
{0x0C,0x12,0x02,0x0C,0x10,0x12,0x0C,0x00},
{0x1E,0x04,0x04,0x04,0x04,0x04,0x04,0x00},
{0x12,0x12,0x12,0x12,0x12,0x12,0x0C,0x00},
{0x12,0x12,0x12,0x12,0x0C,0x0C,0x0C,0x00},
{0x12,0x12,0x12,0x12,0x1E,0x1E,0x12,0x00},
{0x12,0x12,0x0C,0x0C,0x0C,0x12,0x12,0x00},
{0x11,0x11,0x0A,0x04,0x04,0x04,0x04,0x00},
{0x1E,0x10,0x08,0x0C,0x04,0x02,0x1E,0x00},
};
unsignedinttimecount;
unsignedcharcnta;
unsignedcharcntb;
voidmain(void)
{
TMOD=0x01;
TH0=(65536-3000)/256;
TL0=(65536-3000)%6;
TR0=1;
ET0=1;
EA=1;
while(1)
{;
}
}
voidt0(void) interrupt 1using0
{
TH0=(65536-2000)/256;
TL0=(65536-2000)%6;
P1=0XFF;//消除显示重影问题
P0=~digittab[
51单片机LED点阵数字与字 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)