![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Alarm Clock
Fork of SmartRise_MBED by
Diff: TimeControl.cpp
- Revision:
- 9:63098da649d1
- Parent:
- 7:5412a6d7ef6d
- Child:
- 12:f42b74f76630
--- a/TimeControl.cpp Tue Jan 26 01:22:36 2016 +0000 +++ b/TimeControl.cpp Tue Jan 26 01:36:13 2016 +0000 @@ -30,14 +30,14 @@ if(HH>12)hh=HH-12; else hh=HH+1; //convert 24 to 12 hr if(HH>=12) d='P'; else d='A'; //update am/pm //Alarm format - if(AHH>12)Ahh=AHH-12; else Ahh=AHH+1; //convert 24 to 12 hr + if(AHH>12)Ahh=AHH-12; else Ahh=AHH; //convert 24 to 12 hr if(AHH>=12) ad='P'; else ad='A'; lcd.printf(" %2d/%.2d %2d:%.2d%cM Alarm-%2I:%.2I%cM " , t->tm_mon+1,t->tm_mday,hh,t->tm_min,d,Ahh,Amm,ad); //Print date(month/day), time } char checkAlarm(void){ - if(HH==AHH&&mm==Amm) return 1; + if(HH==AHH&&mm==Amm&&d==ad) return 1; else return 0; }