#include <reg52.h>
sbit D1=P1^0;
unsigned char tt;
void main()
{
D1=1;
tt=0;
EA=1;
ET0=1;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
if(tt==20)
D1=!D1;
while(1);
}
void time0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
}
if(tt==20)
D1=!D1;
欢迎光临 (http://www.51hei.com/bbs/) | Powered by Discuz! X3.1 |