alarmclock with 2 alarm times, 128x64 LCD with KS0108, displays time / time&date / a menu to change time & alarms, rotary encoder with push button, relay which switsches on a hi-fi system or something else, a 1F- Cap as a backup supply

Dependencies:   KS0108 QEI mbed

Alarmclock

features:

  • alarmclock with 2 alarm times
  • 128x64 LCD with KS0108
  • displays time / time&date / a menu to change time & alarms
  • sleeptimer, relay is switched of when timer runs out
  • rotary encoder with push button
  • relay which switsches on a hi-fi system or something else
  • a 1F- Cap as a backup supply

todo/ desired improvements/ known issues:

  • a more precise real time clock would be nice
  • a speaker or beeper directly connected to the mbed
  • there is a bug where the big font is not displayed correctly

Schematic:

/media/uploads/gaebu/alarmclock_mbed_128x64.pdf

Revision:
2:fbf734bc04de
Parent:
1:8a7f4f79f84d
--- a/alarmclock.h	Tue Aug 26 21:32:24 2014 +0000
+++ b/alarmclock.h	Tue Jan 05 11:17:59 2016 +0000
@@ -2,26 +2,27 @@
 int temp;
 int i;
 
-int readchar;
-int sleeptimer;
+int pulses;
+volatile int sleeptimer;
+volatile int bltimer;
 //int sleeptime_set;
-char menu, menuold;
+volatile char menu, menuold;
 char menuDisp;
 char set_td_menu;
 char x_day[20];
 char x_time[16];
 char alarmtime[6];
 char cbuf;
-char wheelturned;
-bool blstate;//, blstateold;
+volatile char wheelturned;
+volatile bool blstate;//, blstateold;
 bool alarmset;
 bool alarmon;
 bool alarmset2;
 bool alarmon2;
 bool change_alarm_min;
 bool change_alarm_hour;
-bool wheelpushed,wheelpushedlong,wheelpushchanged;
-bool change_sleeptimer;//, sleeptimerstart;
+volatile bool wheelpushed,wheelpushedlong,wheelpushchanged;
+volatile bool change_sleeptimer;//, sleeptimerstart;
 
 struct tm alarm;
 struct tm alarm2;
@@ -29,6 +30,7 @@
 struct tm *newtime;
 time_t seconds;
 Ticker ticker;
+Timeout blTimeout;
 
 //functions
 void clearmenu();
@@ -38,4 +40,5 @@
 void backlight (bool onoff);
 void checkbutton();
 void setsleeptimer();
-void ticker_tick();
\ No newline at end of file
+void ticker_tick();
+void blTimeout_tick();