mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
Refactoring for easier understanding while coding
Step one: refactor sensor_setup.h -> fdrs_sensor.h
This commit is contained in:
parent
52f0d0c9ce
commit
249904fbc4
@ -5,7 +5,7 @@
|
||||
// Sends ESP-NOW packets at approximately 60Hz.
|
||||
//
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
void setup() {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// (This file will soon be known as 'sensor_config.h')
|
||||
//
|
||||
|
||||
#include <fdrs_globals.h> // Comment if you want to set specific values for this sensor in sensor_setup.h
|
||||
#include <fdrs_globals.h> // Comment if you want to set specific values for this sensor in fdrs_sensor_config.h
|
||||
|
||||
#define READING_ID 3 //Unique ID for this sensor
|
||||
#define GTWY_MAC 0x04 //Address of the nearest gateway
|
@ -6,7 +6,7 @@
|
||||
// An example of how to send data using "fdrs_sensor.h".
|
||||
//
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
float data1;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// (This file will soon be known as 'sensor_config.h')
|
||||
//
|
||||
|
||||
#include <fdrs_globals.h> // Comment if you want to set specific values for this sensor in sensor_setup.h
|
||||
#include <fdrs_globals.h> // Comment if you want to set specific values for this sensor in fdrs_sensor_config.h
|
||||
|
||||
#define READING_ID 1 //Unique ID for this sensor
|
||||
#define GTWY_MAC 0x04 //Address of the nearest gateway
|
@ -6,7 +6,7 @@
|
||||
// An example of how to send data using "fdrs_sensor.h".
|
||||
//
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
float data1;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// (This file will soon be known as 'sensor_config.h')
|
||||
//
|
||||
|
||||
#include <fdrs_globals.h> // Comment if you want to set specific values for this sensor in sensor_setup.h
|
||||
#include <fdrs_globals.h> // Comment if you want to set specific values for this sensor in fdrs_sensor_config.h
|
||||
|
||||
#define READING_ID 2 //Unique ID for this sensor
|
||||
#define GTWY_MAC 0x03 //Address of the nearest gateway
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA.
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <Adafruit_AHTX0.h>
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <Adafruit_BME280.h>
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA.
|
||||
// Connect sensor SDA and SCL pins to those of the ESP.
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <Adafruit_BMP280.h>
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
// Modified by Timm Bogner for Farm Data Relay System -- Untested because I don't have a DHT sensor onhand.
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
#include "DHT.h"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#define ONE_WIRE_BUS 13 //Pin that the DS18B20 is connected to
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
#include <OneWire.h>
|
||||
#include <DallasTemperature.h>
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Reads in GPS data from serial and sends latitude, longitude and altitude to a gateway.
|
||||
//
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
#define SERIAL1_RX 34 // TX pin of GPS sensor
|
||||
|
@ -14,7 +14,7 @@
|
||||
#define USER_BUTTON 35
|
||||
#define DS18B20_PIN 21
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
#include <BH1750.h>
|
||||
#include <Adafruit_BME280.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
// https://github.com/gadjet/Multifunction-ESP8266-Sensor-board
|
||||
//
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <Adafruit_AHT10.h>
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#define REED_PIN 2
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include <fdrs_sensor.h>
|
||||
|
||||
unsigned int theCount = 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// GATEWAY 2.000 Configuration
|
||||
|
||||
#include <fdrs_globals.h> // uncomment if you want to set specific values for this sensor in sensor_setup.h
|
||||
#include <fdrs_globals.h> // uncomment if you want to set specific values for this sensor in fdrs_gateway_config.h
|
||||
#define FDRS_DEBUG
|
||||
|
||||
#define MAC_PREFIX 0xAA, 0xBB, 0xCC, 0xDD, 0xEE // Should only be changed if implementing multiple FDRS systems.
|
||||
|
@ -8,7 +8,7 @@
|
||||
//
|
||||
|
||||
|
||||
#include "sensor_setup.h"
|
||||
#include "fdrs_sensor_config.h"
|
||||
#include "fdrs_sensor.h"
|
||||
|
||||
FDRSLoRa FDRS(GTWY_MAC,READING_ID,SPI_MISO,SPI_MOSI,SPI_SCK,LORA_SS,LORA_RST,LORA_DIO0,FDRS_BAND,FDRS_SF);
|
||||
|
Loading…
Reference in New Issue
Block a user