Kojo / AlarmClock

Dependents:   IF-SmartClock

Revision:
0:d69dc4537754
Child:
1:d544fbfb330c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AlarmClock.h	Thu Jun 25 23:30:44 2015 +0000
@@ -0,0 +1,42 @@
+#ifndef ALARMCLOCK_H
+#define ALARMCLOCK_H
+
+#include "mbed.h"
+#include "7segment4LED.h"
+#include "DigitalClock.h"
+
+class AlarmClock : public DigitalClock {
+public:
+    AlarmClock (PinName seg0, PinName seg1, PinName seg2, PinName seg3, 
+    PinName seg4, PinName seg5, PinName seg6, PinName dot, 
+    PinName digit0, PinName digit1, PinName digit2, PinName digit3,
+    PinName alartB, PinName hourB, PinName minB, PinName toneP
+    );
+    ~AlarmClock();
+    bool getAlarm(int *h, int *min, int *sec) ;
+    bool setAlarm(int h, int min, int sec) ;
+    void alarmTone(bool) ;
+    void poll(void) ;
+    
+private:
+    DigitalIn *alarmButton ;
+    DigitalIn *hourButton ;
+    DigitalIn *minButton ;
+    PwmOut    *tone ;
+
+    void checkAlarmTime(void) ;
+    void checkAlarmButton(void) ;
+    void checkHourButton(void) ; 
+    void checkMinButton(void) ; 
+    void checkButtons(void);
+    void checkTime(void) ;   
+    time_t alarmTime ;
+    bool alarmActive ;
+    bool alarmB_stat ;
+    bool hourB_stat ;
+    bool minB_stat ;
+    bool newAlarmTime ;
+    bool timeMatched ;
+} ;
+
+#endif