Hey all,
I'm just starting to learn about Arduinos and coding.
I had a project idea that I can't get to work.
I have an Arduino Nano and I connected an led and a button.
My goal is to have the LED light up after 36 hours. Once the light is on, a push of the button should reset the light/loop.
I would like to have this as a reminder/notification that my cat's litter box hasn't been cleaned. My wife and I work separate shifts and don't always communicate if the box is clean. Ideally, we would like to see the light on, know that the other hasn't cleaned it, clean it, then be able to reset the light for 36 hours before it comes back on.
I was able to get the project to work for a short timeframe (10000) delay, but not for 36 hours. I converted 36 hours to be (129600000) in milliseconds. To cover the time that the light would stay on, I just added a long delay before it turned off, as we wouldn't wait that long to clean the litter box.
I left the setup running for 3 days and the led never turned on with the (129600000) delay.
It worked when I tried a delay of (10000), so I know everything is wired correctly.
Can anyone please help me with the code portion?
My code that I used was:
void setup() {
pinMode(13, OUTPUT); // pin 13
}
void loop() {
digitalWrite(13, HIGH); // set pin 13 to high voltage, turning LED on
delay(129600000); // wait 129600000 milliseconds, or 36 hours.
digitalWrite(13, LOW); // set pin 13 to low voltage, or zero. LED off.
delay(129600000); // wait 129600000 milliseconds, or 36 hours.
}