题目内容

单片机的P2^0、2^1口分别接发光二极管LED1、LED2,读下列程序:#includesbitLED1=P2^0;sbitLED2=P2^1;unsignedcharCountor1=0,Countor2=0;voidmain(void){TMOD|=0x10;TL1 = 0x00;//设置定时初值 定时50msTH1 = 0x4C;//设置定时初值TR1=1;ET1=1;EA=1;while(1);}voidTime1(void)interrupt3{TL1 = 0x00;//设置定时初值 定时50msTH1 = 0x4C;//设置定时初值Countor1++;Countor2++;if(Countor1==2){LED1=~LED1;Countor1=0;}if(Countor2==8){LED2=~LED2;Countor2=0;}}程序运行结果:

查看答案
更多问题

单片机的P34、P35、P36、P37口分别接发光二极管LED1、LED2、LED3、LED4,输出低电平点亮LED读下列程序:#includeunsigned char count=0,num=0;void main(){TMOD|=0x01; // @11.0592MHzTL0=0xCD;//设置定时初值 2msTH0=0xF8;//设置定时初值TR0=1;ET0=1;EA=1;while(1);}void timer0_ISR(void) interrupt 1{TL0=0xCD;//设置定时初值TH0=0xF8;//设置定时初值if(++count>=250){count=0;P3=~(num<<4);num++;if(num>=16)num=0;}}程序运行结果:

Many people would spend almost two hours watching.[音频]

The second explanation is that they are willing to the terror in order to enjoy at the end.[音频]

They may actually enjoy being, not just relief when the threat is removed.[音频]

答案查题题库