ledsd(); BZ(3); }
//-----------------------对时检查函数------------------ void check() { }
//---------------------------秒表函数----------------------- void K3function() { do {
if(K3==0)
{
do{disp(Asec,Msec,0);}while(K3==0); while(K2==1)
{ }
Msec=counter/2;
if(Msec>99) {Asec++;Msec=0;} if(Asec>99) Asec=0; disp(Asec,Msec,0);
counter=0; if(AH==hour)
{
if(AM==min) BZ(30); }
do{disp(Asec,Msec,0);}while(K2==0);
29
}
if(K2==0)
{
do{disp(Asec,Msec,0);}while(K2==0); Asec=0; Msec=0; }
disp(Asec,Msec,0);
}while(K4==1); }
void K4function() { ON=~ON; if(ON)
BZ(3);
else BZ(1); }
//-------------------主函数-----------------------------------------
void main() { FLAG=0; init_timer(); while(1) {
keyscan();
disp(hour,min,sec); if(ON) check();
30
} }
//--------------------------------END--------------------------------
31
附录二 软件仿真图
32