Adding defines for different board layouts in MyConfig
Adjusted all Gateway examples but only one sensor example so far (DallasTemperature). Other sensor examples should get the same three lines added (not mandatory but helps avoiding unnecessary debugging when selecting the wrong setup)
This commit is contained in:
@@ -4,17 +4,39 @@
|
||||
/***
|
||||
* Configure Sensor Network
|
||||
*/
|
||||
#define COMMDRIVER_NRF24
|
||||
|
||||
// pick ONE of these - other board layouts can be easily added this way
|
||||
#define MYSENSORS_SENSOR
|
||||
//#define MYSENSORS_SERIAL_GATEWAY
|
||||
//#define MYSENSORS_ETHERNET_MQTT_GATEWAY
|
||||
|
||||
#ifdef MYSENSORS_SENSOR
|
||||
#define MYSENSORS_RF_NRF24
|
||||
#define RF24_CE_PIN 9
|
||||
#define RF24_CS_PIN 10
|
||||
#define RF24_PA_LEVEL RF24_PA_MAX
|
||||
#endif
|
||||
|
||||
#ifdef COMMDRIVER_NRF24
|
||||
#ifdef MYSENSORS_SERIAL_GATEWAY
|
||||
#define MYSENSORS_RF_NRF24
|
||||
#define RF24_CE_PIN 9
|
||||
#define RF24_CS_PIN 10
|
||||
#define RF24_PA_LEVEL RF24_PA_LOW
|
||||
#endif
|
||||
|
||||
#ifdef MYSENSORS_ETHERNET_MQTT_GATEWAY
|
||||
#define MYSENSORS_RF_NRF24
|
||||
#define RF24_CE_PIN 5
|
||||
#define RF24_CS_PIN 6
|
||||
#define RF24_PA_LEVEL RF24_PA_LOW
|
||||
#endif
|
||||
|
||||
#ifdef MYSENSORS_RF_NRF24
|
||||
#include "MyDriverNRF24.h"
|
||||
typedef class MyDriverNRF24 MyDriverClass;
|
||||
#define RF24_CHANNEL 76 //RF channel for the sensor net, 0-127
|
||||
#define RF24_DATARATE RF24_250KBPS //RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
|
||||
#define RF24_PA_LEVEL RF24_PA_MAX //Sensor PA Level == RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm, RF24_PA_HIGH=-6dBM, and RF24_PA_MAX=0dBm
|
||||
#define RF24_BASE_RADIO_ID ((uint64_t)0xA8A8E1FC00LL) // This is also act as base value for sensor nodeId addresses. Change this (or channel) if you have more than one sensor network.
|
||||
#define RF24_CE_PIN 9
|
||||
#define RF24_CS_PIN 10
|
||||
#endif
|
||||
|
||||
/***
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include <DallasTemperature.h>
|
||||
#include <OneWire.h>
|
||||
|
||||
#ifndef MYSENSORS_SENSOR
|
||||
#error Please switch to MYSENSORS_SENSOR in MyConfig.h
|
||||
#endif
|
||||
|
||||
#define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected
|
||||
#define MAX_ATTACHED_DS18B20 16
|
||||
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
#include <PinChangeInt.h>
|
||||
#include "GatewayUtil.h"
|
||||
|
||||
#ifndef MYSENSORS_ETHERNET_MQTT_GATEWAY
|
||||
#error Please switch to MYSENSORS_ETHERNET_MQTT_GATEWAY in MyConfig.h
|
||||
#endif
|
||||
|
||||
// Use this if you have attached a Ethernet ENC28J60 shields
|
||||
#include <UIPEthernet.h>
|
||||
|
||||
@@ -62,6 +62,9 @@ http://forum.mysensors.org/topic/303/mqtt-broker-gateway
|
||||
#include <Ethernet.h>
|
||||
#include "MyMQTT.h"
|
||||
|
||||
#ifndef MYSENSORS_ETHERNET_MQTT_GATEWAY
|
||||
#error Please switch to MYSENSORS_ETHERNET_MQTT_GATEWAY in MyConfig.h
|
||||
#endif
|
||||
|
||||
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
|
||||
#define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
|
||||
* - ERR (red) - fast blink on error during transmission error or recieve crc error
|
||||
*/
|
||||
|
||||
|
||||
#define NO_PORTB_PINCHANGES
|
||||
|
||||
#include <SPI.h>
|
||||
@@ -30,6 +30,9 @@
|
||||
#include <PinChangeInt.h>
|
||||
#include "GatewayUtil.h"
|
||||
|
||||
#ifndef MYSENSORS_SERIAL_GATEWAY
|
||||
#error Please switch to MYSENSORS_SERIAL_GATEWAY in MyConfig.h
|
||||
#endif
|
||||
|
||||
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
|
||||
#define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button
|
||||
|
||||
Reference in New Issue
Block a user