單片機(jī)2408點(diǎn)陣時(shí)鐘電子制作
//單片機(jī)點(diǎn)陣電子鐘C語(yǔ)言程序
//MCU:STC89C52RD
//編寫(xiě):桃源客
//電子小制作整理http://www.5imcu.net/轉(zhuǎn)載請(qǐng)保留。
#include
#include
#define uchar unsigned char
#define uint
sbit KEY=P2^7;
uchar keymode;
uchar keydate;
uint
unsigned char c=0;
bit D7,D6;
bit
uchar second,minute,hour;
//以下字模與ASCII對(duì)應(yīng)是,只要將 A-0x20就可以得到A的字模了
//高8*5寬 ASCII碼
//采用"字模提取軟件V2.2"
//提取方式:縱向取模,字節(jié)倒序
uchar code ASCII86[10][5]=
{
{0x3E,0x41,0x49,0x41,0x3E},//0
{0x00,0x42,0x7F,0x40,0x00},//1
{0x72,0x49,0x49,0x49,0x46},//2
{0x21,0x41,0x49,0x4D,0x32},//3
{0x18,0x14,0x12,0x7F,0x10},//4
{0x27,0x45,0x45,0x45,0x38},//5
{0x3C,0x4A,0x49,0x49,0x31},//6
{0x41,0x21,0x11,0x09,0x07},//7
{0x36,0x49,0x49,0x49,0x36},//8
{0x46,0x49,0x49,0x29,0x16},//9
};
uchar code seg[24][3]=
{
{0xfe,0xff,0xff},
{0xfd,0xff,0xff},
{0xfb,0xff,0xff},
{0xf7,0xff,0xff},
{0xef,0xff,0xff},
{0xdf,0xff,0xff},
{0xbf,0xff,0xff},
{0x7f,0xff,0xff},
{0xff,0xfe,0xff},
{0xff,0xfd,0xff},
{0xff,0xfb,0xff},
{0xff,0xf7,0xff},
{0xff,0xef,0xff},
{0xff,0xdf,0xff},
{0xff,0xbf,0xff},
{0xff,0x7f,0xff},
{0xff,0xff,0xfe},
{0xff,0xff,0xfd},
{0xff,0xff,0xfb},
{0xff,0xff,0xf7},
{0xff,0xff,0xef},
{0xff,0xff,0xdf},
{0xff,0xff,0xbf},
{0xff,0xff,0x7f}
};
uchar disbuf[]={0,0,0,0,0,0};//定義緩沖數(shù)組區(qū)
void delay(uchar t);
void init();
void display();
評(píng)論