第1个回答 2020-12-31
#include <reg51.h>
sbit P10=P1^0;
int j;
gr()interrupt 1 using 3
{TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
j++;
if(j==5)
{j=0;
P10=!P10;
}
}
main()
{ET0=1;
EA=1;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
while(1);
}