我要做的是只能
电子钟 有秒表,日期,时钟 闹钟 温度计 ,但是温度计和秒表不知道该怎么弄写 ,求帮忙 !!!(下面我的已经实现时钟 闹钟 日期的显示和调节 )
#include <REGX51.H>
#define uchar unsigned char
#define uint unsigned int
//可位寻址单元的位定义
sbit LE1= P2^0;
sbit LE2= P2^1;
sbit KEY1= P2^2;
sbit KEY2= P2^3;
sbit KEY3= P2^4;
sbit KEY4=P2^5;
sbit SPEAK= P2^6;
sbit KEY5= P2^7;
//共阳LED显示代码
uchar LED_Duanxuan[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,
0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E};
//共阴LED显示代码
uchar LED_Duanxuan1[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,
0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};
//LED位选
uchar LED_weixuan[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
//显示缓冲区
uchar LED_DIS[8]={0,0,0,0,0,0,0,0};
uchar LED_Saomiao =0;
uchar
time_50ms,i=0;
uchar second,minute,hour,minute1,day,mon,year,alhour,almin,alsecond;
uchar number_key;
void delay(void); //延时程序
void display(void);
一周热门 更多>