Farm-Data-Relay-System/Examples/2_ESPNOW_Sensor/2_ESPNOW_Sensor.ino

37 lines
621 B
Arduino
Raw Normal View History

2022-05-21 02:05:29 +00:00
// FARM DATA RELAY SYSTEM
//
// Basic Sensor Example
//
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
// An example of how to send data using "fdrs_sensor.h".
//
#define DEBUG
#define ESPNOW_SENSOR
2022-05-21 02:05:29 +00:00
#include "fdrs_sensor.h"
2022-05-21 23:16:14 +00:00
float data1;
float data2;
2022-05-21 02:05:29 +00:00
void setup() {
beginFDRS();
}
void loop() {
2022-05-21 23:16:14 +00:00
data1=readHum();
2022-05-21 02:05:29 +00:00
loadFDRS(data1, HUMIDITY_T);
2022-05-21 23:16:14 +00:00
data2=readTemp();
2022-05-21 02:05:29 +00:00
loadFDRS(data2, TEMP_T);
sendFDRS();
sleepFDRS(10); //Sleep time in seconds
}
2022-05-21 23:16:14 +00:00
float readTemp(){
return 42.069;
}
float readHum(){
return 21.0345;
}