【文件属性】:
文件名称:电子钟程序
文件大小:398B
文件格式:H
更新时间:2018-05-31 05:39:37
程序
LCD显示的电子钟内含秒表程序#include
#include"config.h"
#include"Lcd1602.h"
#include"Time.h"
#include"KeyControl.h"
unsigned char T0RH;
unsigned char T0RL;
static unsigned char tmr10ms=0,trm100ms=0,enable=0;
void main()
{
T0RH=0xf8;
T0RL=0xcc;
BUZZER=0;
EA=1; //打开定时器
ET0=1;//开启中断
TR0=1; //开始计时
InitLcd1602();
while(1)
{
if(tmr10ms>50)
{
tmr10ms=0;
model1();
trm100ms++;
if(trm100ms==0)
{
model2();
model3();
BuzzerClose();
}
if(trm100ms>=100)
{
model0();
Time();
trm100ms=0;
}
}
}
}
void InterupTimer0() interrupt 1
{
TH0=T0RH;
TL0=T0RL;
tmr10ms++;
KeyScan();
KeyDriver();
Buzzer();
}