EA_BigBen
Test of Embedded Artists LPCXpresso baseboard ethernet, SD card, audio and OLED display facilities.
The program displays the day, date and time on the baseboard OLED and sounds the Big Ben chimes on the hour and quarter hour.
You mean a snooze/alarm clock ?
Have you read EA Big Ben ? very nice clock by Tom Coxon !
http://mbed.org/users/tom_coxon/programs/EA_BigBen/5yxv6
EA_BigBen
Test of Embedded Artists LPCXpresso baseboard ethernet, SD card, audio and OLED display facilities.
The program displays the day, date and time on the baseboard OLED and sounds the Big Ben chimes on the hour and quarter hour.
#define day 60*60*24
#define week 60*60*24*7
#define ALARMTIME 60+5
printf ("\r\nRead tm Values ...\r\n");
seconds = time (NULL);
printf ("\r\n> Read in seconds = %d\r\n", seconds);
t = localtime (&seconds);
printf ("\r\n>> Current smashed time = %04d/%02d/%02d %02d:%02d:%02d ..\r\n :)",
(1900 + t->tm_year),
t->tm_mon ,
t->tm_mday,
t->tm_hour ,
t->tm_min,
t->tm_sec);
// Assume 1 day or 7 day ONLY
if (seconds > week) seconds = seconds - week;
if (seconds == ALARMTIME) PlaySound();
if (SnoozeButton) ALARMTIME = ALARMTIME + SnoozeTime;
Cheers
Ceri
Do you just want some idears ?
<<code>>
#define day 60*60*24
#define week 60*60*24*7
#define ALARMTIME 60+5
printf ("\r\nRead tm Values ...\r\n");
seconds = time (NULL);
printf ("\r\n> Read in seconds = %d\r\n", seconds);
t = localtime (&seconds);
printf ("\r\n>> Current smashed time = %04d/%02d/%02d %02d:%02d:%02d ..\r\n :)",
(1900 + t->tm_year),
t->tm_mon ,
t->tm_mday,
t->tm_hour ,
t->tm_min,
t->tm_sec);
// Assume 1 day or 7 day ONLY
if (seconds > week) seconds = seconds - week;
if (seconds == ALARMTIME) PlaySound();
if (SnoozeButton) ALARMTIME = ALARMTIME + SnoozeTime;
<</code>>
Cheers
**Ceri
Important Information for this Arm website
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
Hey guys, I am currently trying to create a snooze button for an alarm clock. Does anyone know how i should start programming it?