嵌入式电子闹钟()时钟课程设计(15 页)Good is good, but better carries it
精益求精,善益求善
#include //头文件#include#define uchar unsigned char //宏定义#define uint unsigned int//位定义sbit rs=P2^5; //液晶位定义 sbit lcden=P2^7;sbit s1=P2^0; //时间功能切换按键sbit s2=P2^1; //按键加sbit s3=P2^3; //按键减sbit s4=P2^4; //闹钟功能切换键sbit rst=P1^5; //ds1302 引脚定义sbit io=P1^6;sbit sclk=P1^7;sbit beep=P3^0; //蜂鸣器uchar num,count,shi,fen,miao,s1num,s2num,year,month,day,week,flag,flag1,year1,month1,day1,week1,shi1,fen1,miao1,year2,month2,day2,week2,shi2,fen2,miao2,year5,month5,day5,week5,shi5,fen5,miao5,wk,ashi,afen; //参数定义uchar code table[]="20 - - "; //液晶固定显示uchar code table1[]=" : : 00:00";/*uchar time_dat[7]={12,1,6,6,12,59,59}; //年周月日时分秒uchar write_add[7]={0x8c,0x8a,0x88,0x86,0x84,0x82,0x80};uchar read_add[7]={0x8d,0x8b,0x89,0x87,0x85,0x83,0x81};*/vo