Farm-Data-Relay-System/examples/Sensor_Examples/DS18B20_fdrs/DS18B20_fdrs.ino
Timm Bogner 4805072969 more shuffling
- added a modified ThingPulse oled library.
- made "sensor_config" "node_config"
- made - made "fdrs_functions.h" "fdrs_gateway.h"
2023-01-25 19:28:18 -06:00

28 lines
545 B
C++

// FARM DATA RELAY SYSTEM
//
// DS18B20 SENSOR MODULE
//
#define ONE_WIRE_BUS 13 //Pin that the DS18B20 is connected to
#include "fdrs_node_config.h"
#include <fdrs_node.h>
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
beginFDRS();
sensors.begin();
}
void loop() {
sensors.requestTemperatures(); // Send the command to get temperatures
float tempC = sensors.getTempCByIndex(0);
loadFDRS(tempC, TEMP_T);
sendFDRS();
sleepFDRS(60);
}