RTC DS1307 data write on EEPROM

Hi,
I’m newly work on arduino & inteface RTC DS1307 (date & time) data write on eeprom 24LC512. Now date and time already displayed on serial monitor but I want to display date & time on eeprom. so please help me to solve this my problem. I attached code with this so please help me.

rtc_eeprom.ino (1.44 KB)

  float value = analogRead(tempPin); //read sensor value
  float temp = value * 0.48828125;
  EEPROM.write(address, temp);         //write value to current address counter address

EEPROM.write() writes a byte to the EEPROM address specified. Is your temp value a byte ? Answer, no.

I am not sure what you want to do with the data on the EEPROM but until you write it correctly you will not be able to read it back.

Look at the EEPROM.put() function which will enable you to write a float if you really need to.

You should also take note that the EEPROM has a limited number of write cycles which is easy to exceed.

but I want to display date & time on eeprom.

Exactly how do you intend to see what you have "displayed" on the EEPROM?

Hello.

I'm working on a similar project. A chicken egg incubator. I'm using Uno + Ds3231 rtc. I'm having a hard time figuring out how I can store a future date (18 days later) to the Eeprom and then just let a buzzer / light go off. I need to also tilt the tilt trays every 2 hours.

If your interest is actually an event 18 days hence, rather than the data, and you just want to tilt the trays at two hour intervals, the RTC is almost certainly, and the eeprom most certainly, redundant.

Thread hi jack !

When you run your program , can you not press a button that grabs today’s date and adds 18 to it , no need to store in eeprom, keep it in a variable.

DS3231 is a better , more accurate clock - uses same library as the 1307

Nick_Pyner:
If your interest is actually an event 18 days hence, rather than the data, and you just want to tilt the trays at two hour intervals, the RTC is almost certainly, and the eeprom most certainly, redundant.

Till you have a power failure?

Indeed…
Using the eeprom is still unnecessary.