keyscan(); //按键扫描 dingshi();//定时闹钟 Shanshuo30s();//半秒闪烁
shangxia12h ();//上下午指示 } }
void timer0(void) interrupt 1 //定时器0方式1,100ms中断一次 {
TH0=0x3c; //手动加载计数脉冲次数 TL0=0xb0; TMOD=0x11;
mstcnt++; //用于计算时间,每隔100ms加1 if(mstcnt==10)//mstcnt满10即为一秒 {
seconde++;//秒+1
time_pro( ); //时间处理
mstcnt=0; //对计数单元的清零,重新开始计数 } }
相关推荐: