2023-02-22 14:17:38 +00:00
|
|
|
// FARM DATA RELAY SYSTEM
|
|
|
|
//
|
|
|
|
// ESP-NOW Sensor Example
|
|
|
|
//
|
2023-02-25 18:08:21 +00:00
|
|
|
// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA.
|
2023-02-22 14:17:38 +00:00
|
|
|
// An example of how to send data via ESP-NOW using FDRS.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "fdrs_node_config.h"
|
|
|
|
#include <fdrs_node.h>
|
|
|
|
|
2023-03-04 13:42:26 +00:00
|
|
|
void fdrs_recv_cb(DataReading theData)
|
|
|
|
{
|
2023-02-22 14:17:38 +00:00
|
|
|
DBG("ID: " + String(theData.id));
|
|
|
|
DBG("Type: " + String(theData.t));
|
|
|
|
DBG("Data: " + String(theData.d));
|
|
|
|
}
|
|
|
|
|
2023-03-04 13:42:26 +00:00
|
|
|
void setup()
|
|
|
|
{
|
2023-02-22 14:17:38 +00:00
|
|
|
beginFDRS();
|
2023-03-04 13:42:26 +00:00
|
|
|
pingFDRS(1000);
|
2023-02-22 14:17:38 +00:00
|
|
|
addFDRS(fdrs_recv_cb);
|
|
|
|
subscribeFDRS(READING_ID);
|
|
|
|
}
|
2023-03-04 13:42:26 +00:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
loopFDRS();
|
2023-02-22 14:17:38 +00:00
|
|
|
}
|