#include
#include
void Delay(unsigned char a)
{
unsigned char i;
while(--a)
{
for(i=0;i<125;i++);
}
}
void main(void)
{
unsigned char bi;
while(1)
{
b=0xfe;
for(i=0;i<8;i++)
{
P1=b;
Delay(250);
b=_crol_(b1);
}
}
}
#include
void delay1ms()
{
TH1=(65536-1000)/256;
TL1=(65536-1000)%256;
TR1=1;
while(!TF1);
TF1=0;
}
void main()
{
unsigned char code led[]={0xff0x990x000x000x000x810xc30xe7};
unsigned char i;
unsigned int lie;
TMOD=0x10;
while(1)
{
i=0x01;
for(lie=0;lie<8;lie++)
{
P0=i;
P3=led[lie];
delay1ms();
i<<=1;
}
}
}
显示全部