martinayotte wrote:Personally, I prefer handling long delays with millis(), especially if I wish to do something else in the loop(), such as watching for incoming TCP connections. So, so you can trigger tasks with code similar to the following :Code: Select allvoid loop() {
if (millis() - previous_millis > 600000) { // trigger tasks every 10 mins
previous_millis = millis();
// do some task here, or trigger some flags, etc
}
else {
// do something else here, such as checking for incoming connections
}
}
Thank you for your time, but I am afraid this solution doesn't do the job:
ESP8266_DHT_sensor_MQTT.ino: In function 'void loop()':
ESP8266_DHT_sensor_MQTT:67: error: 'previous_millis' was not declared in this scope
ESP8266_DHT_sensor_MQTT.ino: At global scope:
ESP8266_DHT_sensor_MQTT:77: error: expected unqualified-id before '{' token
'previous_millis' was not declared in this scope