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".
|
|
|
|
//
|
|
|
|
|
2022-05-21 21:50:45 +00:00
|
|
|
#define DEBUG
|
2022-05-22 14:10:33 +00:00
|
|
|
#define CREDENTIALS
|
2022-05-21 21:50:45 +00:00
|
|
|
|
|
|
|
#define ESPNOW_SENSOR
|
|
|
|
|
2022-05-22 11:51:52 +00:00
|
|
|
#include <FDRSdefaults.h>
|
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;
|
|
|
|
}
|