#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
uchar num1=0,aa;
void main()
{
P1=0x7f;
TMOD=0x01;
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
EA=1;
ET0=1;
TR0=1;
while(1)
{
if(num1==10)
num1=0;
P1=aa;
aa=_crol_(aa,1);
}
}
void T0_Time() interrupt 1
{
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
num1++;
} |