基于单片机的广告的设计
单片机源程序如下:
- #include <REG52.H>
- unsigned char code table[]={0xfc,0xf3,0xcf,0x3f,0xff,0x00,0xff,0x3f,0xcf,0xf3,0xfc,0xff,0x00,0xff,0x01};//定义广告灯的变化样式
- unsigned char i;
- /******定义延时子程序**********/
- void delay(void)
- {
- unsigned char m,n,s;
- for(m=20;m>0;m--)
- for(n=20;n>0;n--)
- for(s=248;s>0;s--);
- }
- //////////////////////////////
- void main(void)
- {
- while(1)
- {
- if(table[i]!=0x01)
- {
- P0=table[i];
- i++;
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
实验一.rar
(99.63 KB, 下载次数: 28)
|