mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
30 lines
543 B
C++
30 lines
543 B
C++
// FARM DATA RELAY SYSTEM
|
|
//
|
|
// ESP-NOW Sensor Example
|
|
//
|
|
// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA.
|
|
// An example of how to send data via ESP-NOW using FDRS.
|
|
//
|
|
|
|
#include "fdrs_node_config.h"
|
|
#include <fdrs_node.h>
|
|
|
|
void fdrs_recv_cb(DataReading theData)
|
|
{
|
|
DBG("ID: " + String(theData.id));
|
|
DBG("Type: " + String(theData.t));
|
|
DBG("Data: " + String(theData.d));
|
|
}
|
|
|
|
void setup()
|
|
{
|
|
beginFDRS();
|
|
pingFDRS(1000);
|
|
addFDRS(fdrs_recv_cb);
|
|
subscribeFDRS(READING_ID);
|
|
}
|
|
void loop()
|
|
{
|
|
loopFDRS();
|
|
}
|