#define LEDS 6 #include "reg51.h" //led灯选通信号 unsigned char code Select[]={0x01,0x02,0x04,0x08,0x10,0x20}; unsigned char code LED_CODES[]= { 0xc0,0xF9,0xA4,0xB0,0x99,//0-4 0x92,0x82,0xF8,0x80,0x90,//5-9 0x88,0x83,0xC6,0xA1,0x86,//A,b,C,d,E 0x8E,0xFF,0x0C,0x89,0x7F,0xBF//F,空格,P,H,.,- }; void main() { char i=0; long int j;
for(i=0,j=3000;i<=5,j>0;j--) { p1=LED_CODES; p2=Select; i++; } } |