mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
29 lines
651 B
C++
29 lines
651 B
C++
// FARM DATA RELAY SYSTEM
|
|
//
|
|
// MLX90614 INFRARED TEMPERATURE SENSOR MODULE
|
|
//
|
|
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
|
|
|
#include "fdrs_sensor_config.h"
|
|
#include <Adafruit_MLX90614.h>
|
|
#include <fdrs_node.h>
|
|
|
|
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
|
|
|
|
void setup() {
|
|
beginFDRS();
|
|
delay(250);
|
|
DBG("Adafruit MLX90614 test");
|
|
if (!mlx.begin()) {
|
|
DBG("Error connecting to MLX sensor. Check wiring.");
|
|
while (1);
|
|
};
|
|
}
|
|
|
|
void loop() {
|
|
loadFDRS(mlx.readAmbientTempC(), TEMP_T);
|
|
loadFDRS(mlx.readObjectTempC(), TEMP2_T);
|
|
sendFDRS();
|
|
sleepFDRS(60); //Sleep time in seconds
|
|
}
|