From b0b0f866dfe22cea1917d1b0a169568aa98f72c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Sun, 21 Jun 2020 22:49:03 +0200 Subject: [PATCH] Delay in Arduino can be customized --- arduino/tempLightSensor/tempLightSensor.ino | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arduino/tempLightSensor/tempLightSensor.ino b/arduino/tempLightSensor/tempLightSensor.ino index 8da1a55..cacc0ba 100644 --- a/arduino/tempLightSensor/tempLightSensor.ino +++ b/arduino/tempLightSensor/tempLightSensor.ino @@ -5,10 +5,11 @@ #include #include -#define DEBUG_TO_SERIAL 1 // debug on serial port -#define USE_MQTT 1 // use mqtt protocol instead of http post -#define USE_INTERNAL_NTP 0 // use default ntp server or the internal one -#define AREF_VOLTAGE 3.3 // set aref voltage to 3.3v instead of default 5v +#define DEBUG_TO_SERIAL 0 // debug on serial port +#define USE_MQTT 1 // use mqtt protocol instead of http post +#define USE_INTERNAL_NTP 1 // use default ntp server or the internal one +#define TELEMETRY_DELAY 10 // second between telemetry samples +#define AREF_VOLTAGE 3.3 // set aref voltage to 3.3v instead of default 5v char serial[9]; @@ -96,7 +97,7 @@ void setup(void) { } void loop(void) { - const int postDelay = 10 * 1000; + const int postDelay = TELEMETRY_DELAY * 1000; unsigned int tempReading = analogRead(A0); unsigned int photocellReading = analogRead(A1);