STC11F04單片機(jī)制作的32燈搖搖棒
#include
/*********外部接口定義**********/
#define uchar unsigned char
#define uint unsigned int //宏定義
#define out P1 //數(shù)據(jù)輸出端口
sbit led1=P3^0; //第1組LED
sbit led2=P3^1; //第2組LED
sbit led3=P3^3; //第3組LED
sbit led4=P3^4; //第4組LED
sbit key1=P3^5; //按鍵輸入
sbit p3_2=P3^2;
uchar KY; //KY作用在后面說明
uchar BUFF; //緩存
/*********全局變量定義**********/
unsigned long int TimeCount=0;
unsigned int DelayN=80, //延時(shí)臨時(shí)計(jì)數(shù)
DelayTime=80; //每次延時(shí)的周期個(gè)數(shù)
unsigned char key;
/**********************************************/
void delay(unsigned char n);
void DelayMs(void);
/*******************************************/
unsigned char code text1[] = {
0xEF,0x7F,0xEF,0xBC,0x0F,0xDD,0xE0,0xEB,0xEF,0xF3,0x0F,0x8C,0x7F,0xDF,0x7D,0xFF,0x7D,0xBF,0x7D,0x7F,0x0D,0x80,0x75,0xFF,0x79,0xFF,0x7D,0xFF,0x7F,0xFF,0xFF,0xFF,/*"好",0*/
0xEF,0x7F,0xEF,0xBC,0x0F,0xDD,0xE0,0xEB,0xEF,0xF3,0x0F,0x8C,0x7F,0xDF,0x7D,0xFF,0x7D,0xBF,0x7D,0x7F,0x0D,0x80,0x75,0xFF,0x79,0xFF,0x7D,0xFF,0x7F,0xFF,0xFF,0xFF,/*"好",1*/
0xBF,0xFF,0xCF,0xFD,0xEF,0xFD,0xED,0xFD,0xA3,0xFD,0xAB,0xFD,0xAF,0xBD,0xAE,0x7D,0xA1,0x80,0x2B,0xFD,0xAF,0xFD,0xE7,0xFD,0xA8,0xFD,0xCD,0xFD,0xEF,0xFD,0xFF,0xFF,/*"學(xué)",2*/
0xFF,0xFF,0xFF,0xFF,0xFD,0xFB,0xFD,0xF3,0xF5,0xFB,0xED,0xFD,0xDD,0xFD,0x9D,0xFE,0xFD,0xFE,0x7D,0xFF,0x7D,0xDF,0xBD,0xBF,0xFD,0x7F,0x01,0x80,0xF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