Chances are, the OP's project doesn't care what day it is, nor how many days have passed: it only cares about the time of day. And for that, anything epoch-based is overkill.
I still haven't figured out what the project is trying to do.
The OP asked how to make a device that does two things:* * *Seems pretty straightforward to me.
my project is having three functions1st function.... turn on the light automatically at 6 pm and turn off at 6 am daily.2nd function.... turn on the the light when button is pressed and off automatically at 12 pm. and once button is pressed we should not have to press it again....light should be on at the same time when button is pressed earlier and off at 12 automatically.3rd function...same function as 2nd but it is for making the light off;;;; i am using pushbutton to switch between these functions
i am using pushbutton to switch between these functions
What's happening is known as an XY problem. Literally in this case!
but pin 2 and 3 are working great
on button ----pin 3---start the light when i preses the button and off at 12. on the next day. i should not have to press button again. it should be on automatically at the time when i pressed the switch earlier and again should be off at 12 again...this cycle should go on each day automatically until i press the other switchand jump to another function
it means eeprom library is required,, and what should be in the address ?, i am using atmega 328p for my project. Any examples for adresses to write in there.....?