单片机程序
/********************************************************/
#include // 包含51单片机寄存器定义的头文件
unsigned char Tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x7f,0xff}; //control shape
unsigned char port[8]={0xfe,0xfd,0xfb,0xf7};
#define uchar unsigned char
#define uint unsigned int
uchar int_time,second,minute,hour;year,month,daytime;
int a=0;
sbit K1=P3^4; sbit K2=P3^5; sbit K3=P3^6;
/
void delay(uint z)//延时函数
{uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--);}
/********************************************************/
void Displayhourminute(uchar h,m)//显示小时分钟的子程序
{
P2=0xfe; P0=Tab[h/10];delay(1);
P2=0xfd; P0=Tab[h%10];delay(1);
P2=0xfd; P0=Tab[10];delay(1);
P2=0xfb; P0=Tab[m/10];delay(1);
P