求编程实现倒计时的秒表,2位LED数码管显示,延时采用硬件延时的方法_百 ...答:用单片机的定时器T0定时,计时1秒,实现倒计时的秒表的功能。程序如下 include<reg51.h> unsigned char code tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};//共阳数码管段码表 unsigned char second;//秒倒计时变量 unsigned char t0n;//T0中断次数计数 sbit k1=P3^2;/...
设计一个单片机编程,两位的简易秒表,记时单位60-50s,用两位的数码管_百...答:include<reg51.h> unsigend char sec = 0;unsigend char code ledchar[] = {0xC0,x0F9, 0xA4, 0xB0 ,0x99, 0x92, 0x82, 0xF8, 0x80 ,0x90};void ConfigTimer0(){ TMOD = 0x01;TH0 = 0xFC;TL0 = 0x18;ET0 = 1;TR0= 1;EA = 1;} void main(){ ConfigTimer0();whi...