第1个回答 推荐于2017-12-05
#include<reg51.h>
#define uchar unsigned char
uchar led[]={0xff;0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x16};
void delay(int a)
{
uchar i;
while(a--)for(i=0;i<120;i++);
}
main()
{
uchar i;
while(1)
{
P0=led[i];
delay(500);
i++;
i%=10;
}
}本回答被网友采纳