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
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
alarmclock.h@2:fbf734bc04de, 2016-01-05 (annotated)
- Committer:
- gaebu
- Date:
- Tue Jan 05 11:17:59 2016 +0000
- Revision:
- 2:fbf734bc04de
- Parent:
- 1:8a7f4f79f84d
- backligt gets on if input is made and switches off after 5s; - sleeptimer is now working correctly; - new Fonts
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gaebu | 0:62a6f55722d9 | 1 | //variables |
gaebu | 0:62a6f55722d9 | 2 | int temp; |
gaebu | 0:62a6f55722d9 | 3 | int i; |
gaebu | 0:62a6f55722d9 | 4 | |
gaebu | 2:fbf734bc04de | 5 | int pulses; |
gaebu | 2:fbf734bc04de | 6 | volatile int sleeptimer; |
gaebu | 2:fbf734bc04de | 7 | volatile int bltimer; |
gaebu | 1:8a7f4f79f84d | 8 | //int sleeptime_set; |
gaebu | 2:fbf734bc04de | 9 | volatile char menu, menuold; |
gaebu | 0:62a6f55722d9 | 10 | char menuDisp; |
gaebu | 0:62a6f55722d9 | 11 | char set_td_menu; |
gaebu | 0:62a6f55722d9 | 12 | char x_day[20]; |
gaebu | 0:62a6f55722d9 | 13 | char x_time[16]; |
gaebu | 0:62a6f55722d9 | 14 | char alarmtime[6]; |
gaebu | 0:62a6f55722d9 | 15 | char cbuf; |
gaebu | 2:fbf734bc04de | 16 | volatile char wheelturned; |
gaebu | 2:fbf734bc04de | 17 | volatile bool blstate;//, blstateold; |
gaebu | 0:62a6f55722d9 | 18 | bool alarmset; |
gaebu | 0:62a6f55722d9 | 19 | bool alarmon; |
gaebu | 0:62a6f55722d9 | 20 | bool alarmset2; |
gaebu | 0:62a6f55722d9 | 21 | bool alarmon2; |
gaebu | 0:62a6f55722d9 | 22 | bool change_alarm_min; |
gaebu | 0:62a6f55722d9 | 23 | bool change_alarm_hour; |
gaebu | 2:fbf734bc04de | 24 | volatile bool wheelpushed,wheelpushedlong,wheelpushchanged; |
gaebu | 2:fbf734bc04de | 25 | volatile bool change_sleeptimer;//, sleeptimerstart; |
gaebu | 0:62a6f55722d9 | 26 | |
gaebu | 0:62a6f55722d9 | 27 | struct tm alarm; |
gaebu | 0:62a6f55722d9 | 28 | struct tm alarm2; |
gaebu | 0:62a6f55722d9 | 29 | struct tm al_to_change; |
gaebu | 0:62a6f55722d9 | 30 | struct tm *newtime; |
gaebu | 0:62a6f55722d9 | 31 | time_t seconds; |
gaebu | 1:8a7f4f79f84d | 32 | Ticker ticker; |
gaebu | 2:fbf734bc04de | 33 | Timeout blTimeout; |
gaebu | 0:62a6f55722d9 | 34 | |
gaebu | 0:62a6f55722d9 | 35 | //functions |
gaebu | 0:62a6f55722d9 | 36 | void clearmenu(); |
gaebu | 0:62a6f55722d9 | 37 | void setalarm(char alnb); |
gaebu | 0:62a6f55722d9 | 38 | void settimedate(); |
gaebu | 0:62a6f55722d9 | 39 | void printmenu(int selectedline); |
gaebu | 0:62a6f55722d9 | 40 | void backlight (bool onoff); |
gaebu | 0:62a6f55722d9 | 41 | void checkbutton(); |
gaebu | 1:8a7f4f79f84d | 42 | void setsleeptimer(); |
gaebu | 2:fbf734bc04de | 43 | void ticker_tick(); |
gaebu | 2:fbf734bc04de | 44 | void blTimeout_tick(); |