I am developing school alarm system in which i want to save all the alarms from week to eeprom manually using push buttons...like two values hour and minute per alarm...total number of alarms in day may vary..
Rtc and 16x2 lcd circuit is ready with me need guidance in coding..is it possible?
What have you tried so far ? For instance, can you read the time from the RTC and display it on the Serial monitor ? Can you write text to the LCD ?
The libraries required by these devices will come with examples to give you a starting point. There are also examples in the IDE showing how to read an input and determine its state.
1.School alarm system
2.show date and time default
3.when press select button ,menu is loading prints for 3 seconds
4.plz select a day will print
5.up/down keys for increment or decrement Days
6.when selected a day by sel key,saved that data to eeprom
7.enter the number of periods in a day will print
8.up/down keys for inc and dec
9.when selected a number of periods by sel key saved that data to eeprom
10.do you want to fill time for period 1?
Yes/no
11.if sel key press then enter start time for period if no go to period 2
13.cur,inc/dec then save using keys then goto period 2
Fill all the periods
Then data will be stored in the eeprom
And wakeup when day,hour and minute matches..
I want to save one week data to the eeprom..
like first 15 bytes for (day)Monday,number of periods,and alarm hour and time ..
next bytes same for all the days in weeks ..and will wake up on that time
i have developed all the hardware and also got some programming too getting rtc worked and printed date and time on lcd ..but i am getting stuck in saving data to eeprom and wakeup alarm.?
Times may be changed when user wants to..and save it to eeprom until next change of times..yes power can be given all the time..but in case power failure that values needs to remain permenantly saved in eeprom until manual interruption
It's a straightforward choice to use EEPROM. It looks like your user sets it, which requires only a controlled write. After that, if you have RTC or some other real time source, there is no need to write EEPROM because you only need to read the value if you lose power and have to reboot.
On the display you use the names of the week - say alarm on Monday, 9:00.
To easily store these alarms, count the minutes from say Monday, 0:00 onwards. So this Monday, 9:00 alarm is stored as number 540 in the EEPROM: 540 minutes from the start of the week. I assume you don't need more precise times than minutes for this.
The Tuesday, 9:00 alarm would be stored as 1980.
The Wednesday, 12:35 alarm would be stored as 3635.
There are 10,080 minutes in a week so that fits in a 16-bit integer. An Uno has 1024 bytes of EEPROM, which allows you to store 511 alarms plus a the number of alarms, another 16-bit integer. That should be enough.
Use byte 0, 1 for the number of alarms you have.
Byte 2, 3 for the first alarm.
Byte 4, 5 for the second.
Etc.
akshay123:
ok thanks alot sir...
if that time table remains same for next week(no manual settings) and so on ..will that alarms wake up
in that week too?
As I envision it:
The system is on all the time, so no need to wake it up for alarms, though that'd be possible as well using the timers. In that case you'd have to calculate every time how long it takes before the next alarm, and set a wake-up timer to that time period.
It starts counting every week, so if you set the alarms and no changes are made, the next week it'll start all over again with the same set of alarms.