From 5500ab271b8563502d0f78c3b17dc3bdd8175b1e Mon Sep 17 00:00:00 2001 From: sensorsiot Date: Sun, 22 May 2022 01:16:14 +0200 Subject: [PATCH] Added an example to the sensor sketch --- Examples/2_ESPNOW_Sensor/2_ESPNOW_Sensor.ino | 14 ++++++++++++-- Examples/4_UART_Gateway/4_UART_Gateway.ino | 2 ++ Examples/4_UART_Gateway/defaults.h | 4 ---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Examples/2_ESPNOW_Sensor/2_ESPNOW_Sensor.ino b/Examples/2_ESPNOW_Sensor/2_ESPNOW_Sensor.ino index f5be8e2..b9163d8 100644 --- a/Examples/2_ESPNOW_Sensor/2_ESPNOW_Sensor.ino +++ b/Examples/2_ESPNOW_Sensor/2_ESPNOW_Sensor.ino @@ -12,15 +12,25 @@ #include "fdrs_sensor.h" -float data1 = 42.069; -float data2 = 21.0345; +float data1; +float data2; void setup() { beginFDRS(); } void loop() { + data1=readHum(); loadFDRS(data1, HUMIDITY_T); + data2=readTemp(); loadFDRS(data2, TEMP_T); sendFDRS(); sleepFDRS(10); //Sleep time in seconds } + +float readTemp(){ + return 42.069; +} + +float readHum(){ + return 21.0345; +} diff --git a/Examples/4_UART_Gateway/4_UART_Gateway.ino b/Examples/4_UART_Gateway/4_UART_Gateway.ino index a52c345..9acd2e3 100644 --- a/Examples/4_UART_Gateway/4_UART_Gateway.ino +++ b/Examples/4_UART_Gateway/4_UART_Gateway.ino @@ -5,6 +5,8 @@ // Developed by Timm Bogner (timmbogner@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA. // #define DEBUG + +#define ROLE UART_GATEWAY #include "fdrs_config.h" #include "DataReading.h" #ifdef ESP8266 diff --git a/Examples/4_UART_Gateway/defaults.h b/Examples/4_UART_Gateway/defaults.h index e143c85..d0b22a1 100644 --- a/Examples/4_UART_Gateway/defaults.h +++ b/Examples/4_UART_Gateway/defaults.h @@ -32,10 +32,6 @@ #define SS 18 #define RST 14 #define DIO0 26 -//433E6 for Asia -//866E6 for Europe -//915E6 for North America -#define BAND 915E6 //#define USE_LED #define LED_PIN 32