alarm with reset
Dependencies: RTC-DS1307 mbed
main.cpp
- Committer:
- Owenmatthewmcgowan
- Date:
- 2017-05-23
- Revision:
- 0:72a2484d36f7
- Child:
- 1:bd4c4722c453
File content as of revision 0:72a2484d36f7:
#include "mbed.h" #include "Rtc_Ds1307.h" Rtc_Ds1307 rtc(A4,A5) PwmOut buzzer(PTC9) ; DigitalOut gnd(PTC11) ; Rtc_Ds1307::Time_rtc tm = (); Rtc_Ds1307::Time_rtc A_tm = (); bool f_reset bool f_alarm void setalarm(int min, hour) void checktime(int min, hour) //int alarm_on() { // gnd = 0; // buzzer.period(0.1); // buzzer.write(.75); // while(1) {} //} void setalarm(int min, int hour){ &A_tm.min = min ; &A_tm.hour = hour; } //void alarmoff (){ // gnd=0; // buzzer.period(0); // buzzer.write(0); //} void alarmon (){ gnd = 0; buzzer.period(0.1); buzzer.write(.75); } void checktime(int min, int hour){ if (&A_tm.hour == &tm.hour) && ( &A_tm.min == &tm.min ){ if (f_alarm) { alarm_on() } } } //void checkreset() { // if (f_reset) { // alarm_off() // } //}