1
0
mirror of https://github.com/daniviga/bite.git synced 2025-04-20 22:41:18 +02:00

Delay in Arduino can be customized

This commit is contained in:
Daniele Viganò 2020-06-21 22:49:03 +02:00
parent 9dcb86366f
commit b0b0f866df
Signed by: dani
GPG Key ID: DB49AFC03C40EE02

View File

@ -5,9 +5,10 @@
#include <NTPClient.h> #include <NTPClient.h>
#include <ArduinoJson.h> #include <ArduinoJson.h>
#define DEBUG_TO_SERIAL 1 // debug on serial port #define DEBUG_TO_SERIAL 0 // debug on serial port
#define USE_MQTT 1 // use mqtt protocol instead of http post #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 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 #define AREF_VOLTAGE 3.3 // set aref voltage to 3.3v instead of default 5v
char serial[9]; char serial[9];
@ -96,7 +97,7 @@ void setup(void) {
} }
void loop(void) { void loop(void) {
const int postDelay = 10 * 1000; const int postDelay = TELEMETRY_DELAY * 1000;
unsigned int tempReading = analogRead(A0); unsigned int tempReading = analogRead(A0);
unsigned int photocellReading = analogRead(A1); unsigned int photocellReading = analogRead(A1);