|
#include <reg51.h>
sbit MR=P2^7;
void delay()
{
unsigned int i;
for(i=0;i<20000;i++) {}
}
void main()
{
unsigned char index,LED;
SCON=0;
MR=1;
while(1)
{
LED=0X7f;
for(index=0;index<8;index++)
{
SBUF=LED;
do {} while(!TI);
LED=((LED)>>1|0x80);
TI=0;
delay();
}
}
}
|
|