mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
28 lines
625 B
Arduino
28 lines
625 B
Arduino
|
// FARM DATA RELAY SYSTEM
|
||
|
//
|
||
|
// BME280 SENSOR MODULE
|
||
|
//
|
||
|
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
||
|
|
||
|
#include <Adafruit_BME280.h>
|
||
|
#include "fdrs_sensor.h"
|
||
|
|
||
|
Adafruit_BME280 bme;
|
||
|
|
||
|
void setup() {
|
||
|
//Serial.begin(115200);
|
||
|
beginFDRS();
|
||
|
while (!bme.begin(0x76)) {
|
||
|
//Serial.println("BME not initializing!");
|
||
|
delay(10);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
loadFDRS(bme.readTemperature(), TEMP_T);
|
||
|
loadFDRS(bme.readHumidity(), HUMIDITY_T);
|
||
|
loadFDRS(bme.readPressure() / 100.0F, PRESSURE_T);
|
||
|
sendFDRS();
|
||
|
sleepFDRS(60); //Sleep time in seconds
|
||
|
}
|