ad990564125ef4e9
获得 0 次赞
帮助过1人
#include<reg52.h>#define uint unsigned int#define uchar unsigned charsbit led1=P1^0;sbit led2=P1^7;uchar num1=0,num2=0;void main(){ TMOD=0x01; TH0=(65535-45872)/256; TL0=(65535-45872)%256; TH1=(65535-45872)/256; TL1=(65535-45872)%256; EA=1; ET0=1; ET1=1; TR0=1; TR1=1; while(1);}void time0() interrupt 1{ TH0=(65535-45872)/256; TL0=(65535-45872)%256; num1++; if(num1==4) { num1=0; led1=~led1; } }void time1() interrupt 3{ TH1=(65535-45872)/256; TL1=(65535-45872)%256; if(num2==20) { num2=0; led2=~led2; } }这个程序下载到板子上,只有led1灯闪烁,第二个led2灯没反映,为什么?