Commit eacaaab9 authored by user2684's avatar user2684 Committed by GitHub
Browse files

Added support for RS485 (#169)

parent 54868549
...@@ -2713,7 +2713,7 @@ void SensorTSL2561::onProcess(Request & request) { ...@@ -2713,7 +2713,7 @@ void SensorTSL2561::onProcess(Request & request) {
/* /*
SensorPT100 SensorPT100
*/ */
#if MODULE_PT100 == 1
// contructor // contructor
SensorPT100::SensorPT100(NodeManager* node_manager, int child_id, int pin): Sensor(node_manager, child_id, pin) { SensorPT100::SensorPT100(NodeManager* node_manager, int child_id, int pin): Sensor(node_manager, child_id, pin) {
// set presentation, type and value type // set presentation, type and value type
...@@ -2767,7 +2767,7 @@ void SensorPT100::onProcess(Request & request) { ...@@ -2767,7 +2767,7 @@ void SensorPT100::onProcess(Request & request) {
} }
_send(_msg_service.set(function)); _send(_msg_service.set(function));
} }
#endif
/******************************************* /*******************************************
NodeManager NodeManager
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
Default module settings Default module settings
*/ */
// Enable this module to use one of the following sensors: SENSOR_ANALOG_INPUT, SENSOR_LDR, SENSOR_THERMISTOR, SENSOR_ACS712, SENSOR_PT100 // Enable this module to use one of the following sensors: SENSOR_ANALOG_INPUT, SENSOR_LDR, SENSOR_THERMISTOR, SENSOR_ML8511, SENSOR_ACS712, SENSOR_RAIN_GAUGE, SENSOR_RAIN, SENSOR_SOIL_MOISTURE
#ifndef MODULE_ANALOG_INPUT #ifndef MODULE_ANALOG_INPUT
#define MODULE_ANALOG_INPUT 0 #define MODULE_ANALOG_INPUT 0
#endif #endif
...@@ -123,18 +123,14 @@ ...@@ -123,18 +123,14 @@
#ifndef MODULE_DIGITAL_OUTPUT #ifndef MODULE_DIGITAL_OUTPUT
#define MODULE_DIGITAL_OUTPUT 0 #define MODULE_DIGITAL_OUTPUT 0
#endif #endif
// Enable this module to use one of the following sensors: SENSOR_SHT21, SENSOR_HTU21D
#ifndef MODULE_SHT21
#define MODULE_SHT21 0
#endif
// Enable this module to use one of the following sensors: SENSOR_AM2320
#ifndef MODULE_AM2320
#define MODULE_AM2320 0
#endif
// Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22, SENSOR_DHT21 // Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22, SENSOR_DHT21
#ifndef MODULE_DHT #ifndef MODULE_DHT
#define MODULE_DHT 0 #define MODULE_DHT 0
#endif #endif
// Enable this module to use one of the following sensors: SENSOR_SHT21, SENSOR_HTU21D
#ifndef MODULE_SHT21
#define MODULE_SHT21 0
#endif
// Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION // Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION
#ifndef MODULE_SWITCH #ifndef MODULE_SWITCH
#define MODULE_SWITCH 0 #define MODULE_SWITCH 0
...@@ -147,10 +143,6 @@ ...@@ -147,10 +143,6 @@
#ifndef MODULE_BH1750 #ifndef MODULE_BH1750
#define MODULE_BH1750 0 #define MODULE_BH1750 0
#endif #endif
// Enable this module to use one of the following sensors: SENSOR_TSL2561
#ifndef MODULE_TSL2561
#define MODULE_TSL2561 0
#endif
// Enable this module to use one of the following sensors: SENSOR_MLX90614 // Enable this module to use one of the following sensors: SENSOR_MLX90614
#ifndef MODULE_MLX90614 #ifndef MODULE_MLX90614
#define MODULE_MLX90614 0 #define MODULE_MLX90614 0
...@@ -183,6 +175,18 @@ ...@@ -183,6 +175,18 @@
#ifndef MODULE_MHZ19 #ifndef MODULE_MHZ19
#define MODULE_MHZ19 0 #define MODULE_MHZ19 0
#endif #endif
// Enable this module to use one of the following sensors: SENSOR_AM2320
#ifndef MODULE_AM2320
#define MODULE_AM2320 0
#endif
// Enable this module to use one of the following sensors: SENSOR_TSL2561
#ifndef MODULE_TSL2561
#define MODULE_TSL2561 0
#endif
// Enable this module to use one of the following sensors: SENSOR_PT100
#ifndef MODULE_PT100
#define SENSOR_PT100 0
#endif
/*********************************** /***********************************
Supported Sensors Supported Sensors
...@@ -1276,7 +1280,7 @@ class SensorTSL2561: public Sensor { ...@@ -1276,7 +1280,7 @@ class SensorTSL2561: public Sensor {
/* /*
SensorPT100 SensorPT100
*/ */
#if MODULE_PT100 == 1
class SensorPT100: public Sensor { class SensorPT100: public Sensor {
public: public:
SensorPT100(NodeManager* node_manager, int child_id, int pin); SensorPT100(NodeManager* node_manager, int child_id, int pin);
...@@ -1292,6 +1296,7 @@ class SensorPT100: public Sensor { ...@@ -1292,6 +1296,7 @@ class SensorPT100: public Sensor {
DFRobotHighTemperature* _PT100; DFRobotHighTemperature* _PT100;
float _voltageRef = 3.3; float _voltageRef = 3.3;
}; };
#endif
/*************************************** /***************************************
NodeManager: manages all the aspects of the node NodeManager: manages all the aspects of the node
......
...@@ -30,7 +30,7 @@ void before() { ...@@ -30,7 +30,7 @@ void before() {
Serial.begin(MY_BAUD_RATE); Serial.begin(MY_BAUD_RATE);
/* /*
* Register below your device specific config * Register below your sensors
*/ */
......
...@@ -18,9 +18,8 @@ ...@@ -18,9 +18,8 @@
//#define MY_NODE_ID 100 //#define MY_NODE_ID 100
// NRF24 radio settings // NRF24 radio settings
//#define MY_RADIO_NRF24 #define MY_RADIO_NRF24
//#define MY_RF24_ENABLE_ENCRYPTION //#define MY_RF24_ENABLE_ENCRYPTION
//#define MY_RF24_CHANNEL 76 //#define MY_RF24_CHANNEL 76
//#define MY_RF24_PA_LEVEL RF24_PA_HIGH //#define MY_RF24_PA_LEVEL RF24_PA_HIGH
//#define MY_DEBUG_VERBOSE_RF24 //#define MY_DEBUG_VERBOSE_RF24
...@@ -38,6 +37,13 @@ ...@@ -38,6 +37,13 @@
//#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN //#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
//#define MY_RF69_SPI_CS D2 //#define MY_RF69_SPI_CS D2
// RS485 serial transport settings
//#define MY_RS485
//#define MY_RS485_BAUD_RATE 9600
//#define MY_RS485_DE_PIN 2
//#define MY_RS485_MAX_MESSAGE_LENGTH 40
//#define MY_RS485_HWSERIAL Serial1
/********************************** /**********************************
* MySensors gateway configuration * MySensors gateway configuration
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment