#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar tt,aa;//sbit d1=P1^0;
void main()
{
TMOD=0x10; //选择定时器 t0的工作方式为1
EA=1;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
ET1=1;
TR1=1;
aa=0xfe;
while(1)
{
if(tt==2)
{
tt=0;
P1=aa;
aa=_crol_(aa,1);
}
}
}
|