![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Internet alarm clock
Dependencies: EthernetNetIf NTPClient_NetServices mbed
main.h@0:df4b49a4be1a, 2010-10-07 (annotated)
- Committer:
- TyPatrick
- Date:
- Thu Oct 07 19:05:22 2010 +0000
- Revision:
- 0:df4b49a4be1a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TyPatrick | 0:df4b49a4be1a | 1 | #include "mbed.h" |
TyPatrick | 0:df4b49a4be1a | 2 | #include "EthernetNetIf.h" |
TyPatrick | 0:df4b49a4be1a | 3 | #include "NTPClient.h" |
TyPatrick | 0:df4b49a4be1a | 4 | #include "TextLCD.h" |
TyPatrick | 0:df4b49a4be1a | 5 | |
TyPatrick | 0:df4b49a4be1a | 6 | /****************** Class Global Declartions **********************/ |
TyPatrick | 0:df4b49a4be1a | 7 | EthernetNetIf eth; |
TyPatrick | 0:df4b49a4be1a | 8 | NTPClient ntp; |
TyPatrick | 0:df4b49a4be1a | 9 | TextLCD lcd(p5, p6, p7, p8, p9, p10); |
TyPatrick | 0:df4b49a4be1a | 10 | InterruptIn statechange(p23); |
TyPatrick | 0:df4b49a4be1a | 11 | InterruptIn plus(p22); |
TyPatrick | 0:df4b49a4be1a | 12 | InterruptIn minus(p21); |
TyPatrick | 0:df4b49a4be1a | 13 | Ticker ring; |
TyPatrick | 0:df4b49a4be1a | 14 | BusOut led(LED1, LED2, LED3, LED4); |
TyPatrick | 0:df4b49a4be1a | 15 | /******************************************************************/ |
TyPatrick | 0:df4b49a4be1a | 16 | /***************** Standard Global Declartions ********************/ |
TyPatrick | 0:df4b49a4be1a | 17 | |
TyPatrick | 0:df4b49a4be1a | 18 | int menu = 0; // Holds the current menu information |
TyPatrick | 0:df4b49a4be1a | 19 | int timezone = 0; // Timezone is configured as UTC + timezone - 12 |
TyPatrick | 0:df4b49a4be1a | 20 | bool alarmstate = false;// Determines whether the alarm is set or not |
TyPatrick | 0:df4b49a4be1a | 21 | bool ringflag = false; // Determines if alarm is ringing |
TyPatrick | 0:df4b49a4be1a | 22 | bool snooze = false; // True if the alarm has been turned off by a button |
TyPatrick | 0:df4b49a4be1a | 23 | struct tm *cTime; // Stucture that holds the current time |
TyPatrick | 0:df4b49a4be1a | 24 | int ahour; // Value that holds alarm hour |
TyPatrick | 0:df4b49a4be1a | 25 | int amin; // Value that holds alarm minute |
TyPatrick | 0:df4b49a4be1a | 26 | /******************************************************************/ |
TyPatrick | 0:df4b49a4be1a | 27 | /*********************** Function Declartions *********************/ |
TyPatrick | 0:df4b49a4be1a | 28 | void print_lcd(); |
TyPatrick | 0:df4b49a4be1a | 29 | void print_time(int, int); |
TyPatrick | 0:df4b49a4be1a | 30 | void print_menu(); |
TyPatrick | 0:df4b49a4be1a | 31 | void change_menu(); |
TyPatrick | 0:df4b49a4be1a | 32 | void button_press(int); |
TyPatrick | 0:df4b49a4be1a | 33 | void push_plus(); |
TyPatrick | 0:df4b49a4be1a | 34 | void push_minus(); |
TyPatrick | 0:df4b49a4be1a | 35 | void alarm_ring(); |
TyPatrick | 0:df4b49a4be1a | 36 | void alarm_snooze(); |
TyPatrick | 0:df4b49a4be1a | 37 | void alarm_check(); |
TyPatrick | 0:df4b49a4be1a | 38 | /******************************************************************/ |