目录
1、keil 代码实现
# define LEDS 6
# include <reg52.h>
unsigned char code Select[]={0x21,0x02,0x04,0x08,0x10,0x20};
unsigned char code LED_CODES[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,
0x88,0x83,0xC6,0xA1,0x86,0x8E};
void main()
{
char i=0;
long int j;
while(1)
{
P2=0;
P1=LED_CODES[i];
P2=Select[i];
for(j=3000;j>0;j--);
i++;
if(i>5) i=0;
}
}
可以点击如下:
生成hex文件,加载到proteus中去