如何用C51单片机做出以下程序 “秒表是倒计时,从100秒开始倒计时 用数...答:假设P0 P2接数码管,静态驱动,程序如下:include<reg52.h> define uchar unsigned char define uint unsigned int uchar num=100;uchar time=0;//共阴数码管七段码 uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f,0x77};void Delay1ms(uint i) //1ms延时...
利用51单片机,通过两位数码管显示秒,按键实现计时和停止计时 具体内容...答:#TABLE MOVC A,@A+DPTR MOV R3,A SJMP LOOPT0ISR: CLR TR0 MOV TH0,#HIGH(65536-10000) MOV TL0,#LOW(65536-10000) SETB TR0 JB 01H,T0C INC R2T0C: CPL 00H MOV A,R3 JB 00H,T001 MOV P3,#0FDH MOV P2,A SJMP T002T001: MOV P3,#0FEH MOV P2,AT002: ...
这是我的一个51单片机的C语言程序,每当个位数为0的时候,LED灯就闪一...答:include<reg51.h> // 包含51单片机寄存器定义的头文件 unsigned char Tab[ ]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71}; //共阴极段码 unsigned char port[8]={0xfd,0xfe}; //位码 unsigned char int_time;unsigned char...