2022-06-30 13:30:24 +00:00
|
|
|
// FARM DATA RELAY SYSTEM
|
|
|
|
//
|
|
|
|
// Basic Sensor Example
|
|
|
|
//
|
2022-07-19 01:42:42 +00:00
|
|
|
// Developed by Timm Bogner (timmbogner@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
2022-06-30 13:30:24 +00:00
|
|
|
// An example of how to send data using "fdrs_sensor.h".
|
|
|
|
//
|
2022-07-19 01:42:42 +00:00
|
|
|
#include "fdrs_sensor_config.h"
|
2022-06-30 13:30:24 +00:00
|
|
|
|
2022-07-19 01:42:42 +00:00
|
|
|
//#include <fdrs_sensor.h> //Use global functions file
|
|
|
|
#include "fdrs_sensor.h" //Use local functions file
|
2022-06-30 13:30:24 +00:00
|
|
|
|
|
|
|
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() {
|
2022-07-19 01:42:42 +00:00
|
|
|
return 42.4;
|
2022-06-30 13:30:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float readHum() {
|
2022-07-19 01:42:42 +00:00
|
|
|
return 21.2;
|
2022-06-30 13:30:24 +00:00
|
|
|
}
|