Dear All,
I am using arduino nano for my multi event alarm clock project.Here I m using internal eeprom of nano to store multiple alarms data. I want toused 336 bytes of eeprom to store weekly data of alarm.project runs but after sometime it shows error data of alarm.and alarm rings anytime.as i use lcd 16x2 to display time & alarm.image is attached.you can see my arduino code here.
You say Aduino Nano, but picture shows Arduino Uno.
You say internal EEPROM, but the picture shows external EEPROM.
"After some time" is what? Seconds, hours years?
What does "shows error data" mean? What data? Where? On the display?
General comments:
1. you can eliminate about 90% of your code by using loops to read the EEPROM instead of a function call to every address.
2. the DS3232 only updates once per second but you read it continuously in a loop. If you connect it's INT/SQW pin to the MCU so it interrupts every second it will release much of the time spent repeatedly reading the same values.
3. be careful with bracketing complex 'if' statements. Remember each part of the 'if' returns true or false so it is safer to write:
Code:
if (hh==7 && mm==20 && ss==00 && mode_status ==1)
as
Code:
if ((hh==7) && (mm==20) && (ss==00) && (mode_status ==1))
4. consider grouping some of your lines into functions and calling them as required instead of doing everything in-line.