So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By johnnyfrx
#66862
ESP8266_LDR_IFTTT_SmartThings_BlueTooth_WIFI_Toggle_Share.ino
Good Day,
I am in need of a delay replacement that will pause the entire loop for upward of 20hrs.
Traditional delay works fine for a 1 hour delay. Anything past that and code locks up.
See attached sketch. My troublesome delay is at line 125.
Scenario - LDR sensor trips at designated low light threshold. Once tripped WiFi turns on, sends POST to IFTTT, WiFi turns off, Delay begins. (Delay is needed so the LDR doesn't continue to sense low-light overnight.)
Please take a look and let me know what you think.
Thanx,
JohnnyFRX
You do not have the required permissions to view the files attached to this post.
User avatar
By johnnyfrx
#66867 I tried something like this with no luck.

const unsigned long seconds = 1000L;
const unsigned long minutes = 60000L;
const unsigned long hours = 3600000L;
const unsigned long myDelay = 32400000L;
const unsigned long myTestdelay = hours * 2;
const unsigned long mySecondsdelay = seconds * 10;