![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Alarm Clock
Fork of SmartRise_MBED by
You are viewing an older revision! See the latest version
Stephens_Sloop_Final_Project_Alarm_Clock
Device Description¶
Smart Rise is an alarm clock that allows the user to place the alarm off-switch anywhere in their residence or close outside. It’s LCD display provides the date, time, and the set alarm time. The Alarm time can be adjusted through the use of three buttons while the time and date are kept automatically.
Hardware Overview¶
LPC1768 LCD Display (Display Module) 2 XBee Series 1 trace antennas 2 Speakers
Software Overview¶
Used TextLCD.h library to display information on the LCD screen Used standard mbed.h library methods to set and calculate time Configured XBees to transparent mode with the remote XBee controlling the local (with the mbed) XBee Programmed the mbed to play Star Wars using Pulse Width Modulation
Program Flow¶
The program first initializes alarm time and the actual time, then it initializes the Interrupt in method to turn off the alarm. The program then repeats a loop checking for inputs that would adjust the alarm setting. In the loop, the time is also compared to the set alarm time and if they are the same, the alarm is sounded until the interrupt is triggered.
Key Functions¶
- time_init (initializes the time and alarm time)
- Sound_Alarm (turns on the alarm)
- turn_off (turns off the alarm)
- turn_on (readies the alarm to be turned on again)
- checkAlarm (compares the alarm time to the actually time)
- timeDisplay (displays the time and date to the LCD screen)
- timeProg (function to set the actual time)
- alarmProg (function to set the alarm time)
Background on New Methods¶
How to use mbed and C time libraries How to Turn of an alarm using a remote XBEE How to better use the the TextLCD library to format and display time Use logic to compare time variables