用数码管设计一个秒表,使之显示从0~60(用内部定时器),数码管段码由P2...答:unsigned char code Tab[11]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};//数码管显示0~9的段码表 unsigned char int_time; //记录中断次数 unsigned char second; //储存秒 / 函数功能:快速动态扫描延时,延时约0.6毫秒 / void delay(void){ unsigned char i;for...
如何用51单片机用单数码管做9s的简易秒表?答:假设P0接数码管,程序如下:include<reg52.h> define uchar unsigned char define uint unsigned int uchar a=0;uchar b=9;//共阴数码管七段码 uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f,0x77};void delay(uchar aa)//延时子程序 { uchar bb,cc;fo...
如何用8位数码管显示秒表答:MOVB,#10 DIV AB MOV DPTR,#TABLE MOVCA,@A+DPTR MOV P0,A MOV A,B MOVCA,@A+DPTR MOV P2,A LCALL DELY1S INCSecond MOV A,Second CJNE A,#60,NEXT LJMPSTART DELY1S: MOVR5,#100 D2: MOV R6,#20 D1: MOVR7,#248 DJNZ R7,DJNZ R6,D1 DJNZR5,D2 RET TABLE: ...