Refactoring for easier understanding while coding

Step one: refactor sensor_setup.h -> fdrs_sensor.h
This commit is contained in:
Sascha 2022-07-11 15:59:47 +02:00
parent 52f0d0c9ce
commit 249904fbc4
28 changed files with 17 additions and 17 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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"

View File

@ -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>

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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.

View File

@ -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);