用单片机设计一个时钟,可显示时和分,可以调时间,也要有闹钟功能,要有设...答:其实不用定时中断也能实现功能:include<reg51.h> 主函数 unsigned char tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};定义0-9数组 unsigned int tmp;定义变量 void delay(unsigned int xms)定义延时函数 {unsigned int j,i;for(i=0;i<xms;i++)for(j=0;j<100...
跪求单片机c51一个多功能时钟设计。要闹钟。调整时间、秒表、就行了...答:void display(second10,second1,minute10,minute1,hour10,hour1) //显示子程序unsigned char second10,second1,minute10,minute1,hour10,hour1; { P2=0xfe; P0=dispcode[second10];//显示秒的十位 delay(1); P2=0xfd; P0=dispcode[second1]; //显示秒的个位 delay(1); P2=0xfb; P0=dispcode[10...