mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
42 lines
822 B
C++
42 lines
822 B
C++
// FARM DATA RELAY SYSTEM
|
|
//
|
|
// ESP-NOW Sensor Example
|
|
//
|
|
// Developed by Timm Bogner (timmbogner@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
|
// An example of how to send data via ESP-NOW using FDRS.
|
|
//
|
|
|
|
#include "fdrs_sensor_config.h"
|
|
#include <fdrs_node.h>
|
|
|
|
float data1;
|
|
float data2;
|
|
|
|
|
|
|
|
void ctrl_1_cb(DataReading* theData){DBG("C1");}
|
|
void ctrl_2_cb(DataReading* theData){DBG("C2");}
|
|
void ctrl_3_cb(DataReading* theData){DBG("C3");}
|
|
void ctrl_4_cb(DataReading* theData){DBG("C4");}
|
|
|
|
void setup() {
|
|
beginFDRS();
|
|
addFDRS(1000);
|
|
}
|
|
void loop() {
|
|
// data1 = readHum();
|
|
// loadFDRS(data1, HUMIDITY_T);
|
|
// data2 = readTemp();
|
|
// loadFDRS(data2, TEMP_T);
|
|
// sendFDRS();
|
|
// sleepFDRS(10); //Sleep time in seconds
|
|
}
|
|
|
|
float readTemp() {
|
|
return 22.069;
|
|
}
|
|
|
|
float readHum() {
|
|
return random(0,100);
|
|
}
|