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

33 lines
584 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".
//
#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() {
data1 = readHum();
2022-05-21 02:05:29 +00:00
loadFDRS(data1, HUMIDITY_T);
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;
2022-05-21 23:16:14 +00:00
}
float readHum() {
2022-05-21 23:16:14 +00:00
return 21.0345;
}