资源描述:
《LED点阵屏从上向下滚动显示》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、LED点阵屏从上向下滚动显示!!!!!LED点阵屏,我用四块8×8组成的8×32点阵。做了个时钟,显示时间,年,月,日和星期五种状态用下移切换。程序写的不好,还请各位多多指教。视频在http://www.tvix.cn/play.php?v=mlcHH8qtdSK可以看到!!!!!!!!过几天把图一起传上来。#include #define uchar unsigned char#define uint unsigned int#define off 0#define on 1/*sfr P1M0=0x91;sfr P1M
2、1=0x92;sfr P3M0=0xb1;sfr P3M1=0xb2;*/sbit aa=P1^0;sbit ab=P1^1;sbit ac=P1^2;sbit ag=P1^3;sbit ba=P1^4;sbit bb=P1^5;sbit bc=P1^6;sbit bg=P1^7;sbit ca=P2^0;sbit cb=P2^1;sbit cc=P2^2;sbit cg=P2^3;sbit da=P2^4;sbit db=P2^5;sbit dc=P2^6;sbit dg=P2^7;sbit onekey=P3^3;sbit twokey
3、=P3^2;sbit threekey=P3^5;sbit fourkey=P3^4;sbit bt=P3^6;sbit bbt=P3^7;bit keystoke;bit secdisplay;bit down;bit up;bit key_adjust;uchar auttch;uchar cgb,hour,min,sec,lb,day,month,days,counter,tier,displaycount,x;uchar downcount,autotch,days,week,clockkey,cgb,mov,yearb,yearc
4、tch_timer;uint c,ccc,year,yeara;uchar code displaycode[32]={0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07}; //32个位uchar code abc[6][6]={{0x24,
5、0x3A,0x2B,0xFE,0x2A,0x2A},//年{0xFC,0x54,0xFC},//月{0xFC,0x94,0xFC},//日{0x7F,0x80,0x7F,0x7F,0x80,0x7F},//W{0xFF,0x89,0x89,0x81},//E{0xFF,0x14,0x22,0x41,0x80}};//Kuchar code count[10][6]={ {0x7E,0x81,0x81,0x81,0x81,0x7E},//0 {0x00,0x00,0x82,0xFF,0x80,0x00},//1 {0xE2,0x91,0
6、x91,0x91,0x91,0x8E},//2 {0x42,0x89,0x89,0x89,0x89,0x76},//3 {0x30,0x28,0x24,0x22,0xFF,0x20},//4 {0x8F,0x89,0x89,0x89,0x89,0x70},//5 {0x7E,0x89,0x89,0x89,0x89,0x72},//6 {0x01,0x01,0xF9,0x05,0x03,0x01},//7 {0x76,0x89,0x89,0x89,0x89,0x76},//8 {0x4E,0x91,0x91,0x91,0x91,
7、0x7E}};//9uchar code count1[10][6]={ {0x00,0x00,0x00,0x00,0x00,0x00},//0 {0x00,0x00,0x82,0xFF,0x80,0x00},//1 {0xE2,0x91,0x91,0x91,0x91,0x8E},//2 {0x42,0x89,0x89,0x89,0x89,0x76},//3 {0x30,0x28,0x24,0x22,0xFF,0x20},//4 {0x8F,0x89,0x89,0x89,0x89,0x70},//5 {0x7E,0x89,0x
8、89,0x89,0x89,0x72},//6 {0x01,0x01,0xF9,0x05,0x03,0x01},//7 {0x76,0x89,0x89,0x89,0x89,0x