各种花样的数字led灯点阵显示1

/********************************************************************************************LED点阵实验(流动显示123456789)**说明通过P0和P2作为点阵接口**要求学员掌握LED点阵的工作原理和各点阵脚的定义及接法,具体接线请参考接线说明**我们采用的LED点阵式是低功耗,在做实验时可以用单片机脚直接驱动*******************************************************************************************/#includeunsignedcharcodetab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};unsignedcharcodedigittab[73][8]={{0X00,0X00,0X00,0X00,0X08,0X00,0X00,0X00},//0{0X00,0X00,0X00,0X14,0X22,0X14,0X00,0X00},{0X00,0X00,0X3E,0X41,0X41,0X41,0X3E,0x00},{0X18,0X08,0X00,0X00,0X00,0X00,0X00,0X00},//1{0X08,0X18,0X08,0X00,0X00,0X00,0X00,0X00},{0X08,0X08,0X18,0X08,0X00,0X00,0X00,0X00},{0X08,0X08,0X08,0X18,0X08,0X00,0X00,0X00},{0X08,0X08,0X08,0X08,0X18,0X08,0X00,0X00},{0X1C,0X08,0X08,0X08,0X08,0X18,0X08,0X00},{0X00,0X00,0X00,0X21,0X7F,0X01,0X00,0X00},{0X00,0X00,0X10,0X10,0X10,0X10,0X10,0X00},//2{0X00,0X00,0XE0,0XA0,0XA0,0XA0,0X20,0X00},{0X00,0X00,0X38,0X28,0X28,0X28,0XC8,0X00},{0X00,0X00,0X4E,0X8A,0X8A,0X8A,0X72,0X00},{0X00,0X00,0X27,0X45,0X45,0X45,0X39,0X00},{0X00,0X00,0X00,0X1c,0X1c,0X1c,0X00,0X00},//{0X00,0X00,0X2e,0X28,0X3e,0X0a,0X3a,0X00},{0X00,0X4F,0X48,0X48,0X7F,0X09,0X09,0X79},{0X00,0X4F,0X48,0X48,0X7F,0X09,0X09,0X79},{0XFF,0XFF,0XD5,0XD5,0X0D5,0XC1,0Xff,0XFF},//hei3{0XFF,0XFF,0XD5,0X2D5,0XD5,0XC1,0Xff,0XFF},{0XFF,0XFF,0XD5,0XD5,0XD5,0XC1,0Xff,0XFF},{0X00,0X00,0X22,0X49,0X49,0X49,0X36,0X00},//liang3{0X08,0X10,0X20,0X40,0X00,0X00,0X00,0X00},//4{0X08,0X18,0X28,0X48,0X08,0X08,0X08,0X00},{0X08,0X18,0X28,0X48,0X7F,0X08,0X08,0X00},{0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00},//5{0X00,0X00,0X20,0X40,0X40,0X40,0X20,0X00},//6{0X00,0X00,0X30,0X40,0X40,0X00,0X00,0X00},{0X00,0X00,0X38,0X40,0X40,0X00,0X00,0X00},{0X00,0X00,0X3c,0X40,0X00,0X00,0X00,0X00},{0X00,0X00,0X3E,0X00,0X00,0X00,0X00,0X00},{0X00,0X00,0X1E,0X01,0X00,0X00,0X00,0X00},{0X00,0X00,0X0E,0X01,0X01,0X00,0X00,0X00},{0X00,0X00,0X06,0X01,0X01,0X01,0X00,0X00},{0X00,0X00,0X02,0X01,0X01,0X01,0X02,0X00},{0X00,0X00,0X00,0X01,0X01,0X01,0X06,0X00},{0X00,0X00,0X00,0X00,0X01,0X09,0X06,0X00},{0X00,0X00,0X00,0X00,0X08,0X09,0X06,0X00},{0X00,0X00,0X00,0X08,0X08,0X08,0X06,0X00},{0X00,0X00,0X00,0X08,0X08,0X09,0X06,0X00},{0X00,0X00,0X00,0X08,0X09,0X09,0X06,0X00},{0X00,0X00,0X00,0X09,0X09,0X09,0X06,0X00},{0X00,0X00,0X02,0X09,0X09,0X09,0X06,0X00},{0X00,0X00,0X06,0X09,0X09,0X09,0X06,0X00},{0X00,0X00,0X0E,0X09,0X09,0X09,0X06,0X00},{0X00,0X00,0X1E,0X09,0X09,0X09,0X06,0X00},{0X00,0X00,0X3E,0X09,0X09,0X09,0X06,0X00},{0X00,0X00,0X3E,0X49,0X09,0X09,0X06,0X00},{0X00,0X00,0X3E,0X49,0X49,0X09,0X06,0X00},{0X00,0X00,0X3E,0X49,0X49,0X49,0X06,0X00},{0X00,0X00,0X3E,0X49,0X49,0X49,0X26,0X00},{0X00,0X00,0X00,0X40,0X00,0X4A,0X20,0X00},//7{0X00,0X00,0X40,0X00,0X40,0X05,0X50,0X00},{0X00,0X00,0X40,0X40,0X40,0X4F,0X70,0X00},{0X00,0X06,0X6F,0XFF,0XFF,0X6F,0X06,0X00},//8{0X00,0X06,0X6F,0XBF,0XBF,0X6F,0X06,0X00},{0X00,0X06,0X6F,0X9f,0X9f,0X6F,0X06,0X00},{0X00,0X06,0X6F,0X97,0X97,0X6F,0X06,0X00},{0X00,0X06,0X6B,0X93,0X93,0X6B,0X06,0X00},{0X00,0X06,0X69,0X91,0X91,0X69,0X06,0X00},{0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00},//9{0x30,0x48,0x88,0x90,0x62,0x22,0x14,0x08},//zuoshang9{0x00,0x38,0x44,0x44,0x78,0x40,0x44,0x38},//zuo9{0x0c,0x12,0x31,0x49,0x46,0x40,0x30,0x00},//zuoxia9{0x00,0x00,0x3e,0x49,0x49,0x49,0x26,0x00},//dao9{0x30,0x48,0x84,0x8e,0x11,0x21,0x22,0x1c},//youxia9{0x1c,0x22,0x02,0x1e,0x22,0x22,0x1c,0x00},//you9{0x00,0x1c,0x02,0x61,0x92,0x8c,0x48,0x30},//youshang9{0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00},//9{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00},//9};unsignedinttimecount;unsignedcharcnta;unsignedcharcntb;voidmain(void){TMOD=0x01;TH0=(65536-3000)/256;TL0=(65536-3000)%256;TR0=1;//开启定时0ET0=1;EA=1;//开启中断cntb=0;while(1){;}}/***************************************************定时中断********************************************************/voidt0(void)interrupt1using0{TH0=(65536-3000)/256;//定时器高位装载数据TL0=(65536-3000)%256;//定时器低位装载数据if(cnta<73)//红色{P1=0xFF;P2=tab[cntb];P0=digittab[cnta][cntb];}else//绿色{P2=0xFF;P1=tab[cntb];P0=digittab[cnta-73][cntb];}if(++cntb>=8)cntb=0;if(++timecount>=200){timecount=0;if(++cnta>=146)cnta=0;}}

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供参考,付费前请自行鉴别。
3、如文档内容存在侵犯商业秘密、侵犯著作权等,请点击“举报”。

常见问题具体如下:

1、问:已经付过费的文档可以多次下载吗?

      答:可以。登陆您已经付过费的账号,付过费的文档可以免费进行多次下载。

2、问:已经付过费的文档不知下载到什么地方去了?

     答:电脑端-浏览器下载列表里可以找到;手机端-文件管理或下载里可以找到。

            如以上两种方式都没有找到,请提供您的交易单号或截图及接收文档的邮箱等有效信息,发送到客服邮箱,客服经核实后,会将您已经付过费的文档即时发到您邮箱。

注:微信交易号是以“420000”开头的28位数字;

       支付宝交易号是以“2024XXXX”交易日期开头的28位数字。

客服邮箱:

biganzikefu@outlook.com

所有的文档都被视为“模板”,用于写作参考,下载前须认真查看,确认无误后再购买;

文档大部份都是可以预览的,笔杆子文库无法对文档的真实性、完整性、准确性以及专业性等问题提供审核和保证,请慎重购买;

文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为依据;

如果您还有什么不清楚的或需要我们协助,可以联系客服邮箱:

biganzikefu@outlook.com

常见问题具体如下:

1、问:已经付过费的文档可以多次下载吗?

      答:可以。登陆您已经付过费的账号,付过费的文档可以免费进行多次下载。

2、问:已经付过费的文档不知下载到什么地方去了?

     答:电脑端-浏览器下载列表里可以找到;手机端-文件管理或下载里可以找到。

            如以上两种方式都没有找到,请提供您的交易单号或截图及接收文档的邮箱等有效信息,发送到客服邮箱,客服经核实后,会将您已经付过费的文档即时发到您邮箱。

注:微信交易号是以“420000”开头的28位数字;

       支付宝交易号是以“2024XXXX”交易日期开头的28位数字。

确认删除?