#include<reg52.h>
unsigned char led_tab[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void delay_ms(unsigned int t) //XmsÑÓʱº¯Êý
{
unsigned int a,b;
for(a=0;a<t;a++)
{
for(b=0;b<113;b++)
{;}
}
}
void main()
{
unsigned char i;
while(1)
{
for(i=0;i<8;i++) //Ñ»·Ö´ÐÐ8´Î£¬¾Í¿ÉÒÔÖð´Î½«8¸öLEDµãÁÁ
{
P1=led_tab; //È¡³öµÚi¸öÊý¾Ý¸øP1£¬µãÁÁµÚi¸öLED
delay_ms(300);
}
}
}
|