// 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
// Enable this module to use one of the following sensors: SENSOR_ANALOG_INPUT, SENSOR_LDR, SENSOR_THERMISTOR, SENSOR_ML8511, SENSOR_ACS712, 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
...
@@ -202,6 +203,10 @@
...
@@ -202,6 +203,10 @@
#ifndef MODULE_DIMMER
#ifndef MODULE_DIMMER
#define MODULE_DIMMER 0
#define MODULE_DIMMER 0
#endif
#endif
// Enable this module to use one of the following sensors: SENSOR_RAIN_GAUGE, SENSOR_POWER_METER, SENSOR_WATER_METER
#ifndef MODULE_PULSE_METER
#define MODULE_PULSE_METER 0
#endif
/***********************************
/***********************************
Supported Sensors
Supported Sensors
...
@@ -218,8 +223,6 @@ enum supported_sensors {
...
@@ -218,8 +223,6 @@ enum supported_sensors {
SENSOR_ML8511,
SENSOR_ML8511,
// Current sensor
// Current sensor
SENSOR_ACS712,
SENSOR_ACS712,
// rain gauge sensor
SENSOR_RAIN_GAUGE,
// Rain sensor, return the percentage of rain from an attached analog sensor
// Rain sensor, return the percentage of rain from an attached analog sensor
SENSOR_RAIN,
SENSOR_RAIN,
// Soil moisture sensor, return the percentage of moisture from an attached analog sensor
// Soil moisture sensor, return the percentage of moisture from an attached analog sensor
...
@@ -315,6 +318,14 @@ enum supported_sensors {
...
@@ -315,6 +318,14 @@ enum supported_sensors {
// Generic dimmer sensor used to drive a pwm output
// Generic dimmer sensor used to drive a pwm output
SENSOR_DIMMER,
SENSOR_DIMMER,
#endif
#endif
#if MODULE_PULSE_METER == 1
// rain gauge sensor
SENSOR_RAIN_GAUGE,
// power meter pulse sensor
SENSOR_POWER_METER,
// water meter pulse sensor
SENSOR_WATER_METER,
#endif
};
};
/***********************************
/***********************************
...
@@ -519,6 +530,8 @@ class Sensor {
...
@@ -519,6 +530,8 @@ class Sensor {
intgetValueType();
intgetValueType();
// [11] for float values, set the float precision (default: 2)
// [11] for float values, set the float precision (default: 2)
voidsetFloatPrecision(intvalue);
voidsetFloatPrecision(intvalue);
// [21] for double values, set the double precision (default: 4)
voidsetDoublePrecision(intvalue);
#if POWER_MANAGER == 1
#if POWER_MANAGER == 1
// to save battery the sensor can be optionally connected to two pins which will act as vcc and ground and activated on demand
// to save battery the sensor can be optionally connected to two pins which will act as vcc and ground and activated on demand
@@ -172,7 +172,7 @@ The next step is to enable NodeManager's additional functionalities and the modu
...
@@ -172,7 +172,7 @@ The next step is to enable NodeManager's additional functionalities and the modu
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
#define SERVICE_MESSAGES 0
#define SERVICE_MESSAGES 0
// 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
// Enable this module to use one of the following sensors: SENSOR_ANALOG_INPUT, SENSOR_LDR, SENSOR_THERMISTOR, SENSOR_ML8511, SENSOR_ACS712, SENSOR_RAIN, SENSOR_SOIL_MOISTURE
#define MODULE_ANALOG_INPUT 1
#define MODULE_ANALOG_INPUT 1
// Enable this module to use one of the following sensors: SENSOR_DIGITAL_INPUT
// Enable this module to use one of the following sensors: SENSOR_DIGITAL_INPUT
#define MODULE_DIGITAL_INPUT 1
#define MODULE_DIGITAL_INPUT 1
...
@@ -214,6 +214,8 @@ The next step is to enable NodeManager's additional functionalities and the modu
...
@@ -214,6 +214,8 @@ The next step is to enable NodeManager's additional functionalities and the modu
#define MODULE_BMP280 0
#define MODULE_BMP280 0
// Enable this module to use one of the following sensors: SENSOR_DIMMER
// Enable this module to use one of the following sensors: SENSOR_DIMMER
#define MODULE_DIMMER 0
#define MODULE_DIMMER 0
// Enable this module to use one of the following sensors: SENSOR_RAIN_GAUGE, SENSOR_POWER_METER, SENSOR_WATER_METER
#define MODULE_PULSE_METER 0
~~~
~~~
### Installing the dependencies
### Installing the dependencies
...
@@ -441,6 +443,8 @@ SENSOR_AM2320 | AM2320 sensors, return temperature/humidity based on the attache
...
@@ -441,6 +443,8 @@ SENSOR_AM2320 | AM2320 sensors, return temperature/humidity based on the attache
SENSOR_PT100 | High temperature sensor associated with DFRobot Driver, return the temperature in C° from the attached PT100 sensor
SENSOR_PT100 | High temperature sensor associated with DFRobot Driver, return the temperature in C° from the attached PT100 sensor
SENSOR_BMP280 | BMP280 sensor, return temperature/pressure based on the attached BMP280 sensor
SENSOR_BMP280 | BMP280 sensor, return temperature/pressure based on the attached BMP280 sensor
SENSOR_DIMMER | Generic dimmer sensor used to drive a pwm output
SENSOR_DIMMER | Generic dimmer sensor used to drive a pwm output
SENSOR_POWER_METER | Power meter pulse sensor
SENSOR_WATER_METER | Water meter pulse sensor
To register a sensor simply call the NodeManager instance with the sensory type and the pin the sensor is conncted to and optionally a child id. For example:
To register a sensor simply call the NodeManager instance with the sensory type and the pin the sensor is conncted to and optionally a child id. For example:
~~~c
~~~c
...
@@ -519,6 +523,8 @@ The following methods are available for all the sensors and can be called on the
...
@@ -519,6 +523,8 @@ The following methods are available for all the sensors and can be called on the
intgetValueType();
intgetValueType();
// [11] for float values, set the float precision (default: 2)
// [11] for float values, set the float precision (default: 2)
voidsetFloatPrecision(intvalue);
voidsetFloatPrecision(intvalue);
// [21] for double values, set the double precision (default: 4)
voidsetDoublePrecision(intvalue);
#if POWER_MANAGER == 1
#if POWER_MANAGER == 1
// to save battery the sensor can be optionally connected to two pins which will act as vcc and ground and activated on demand
// to save battery the sensor can be optionally connected to two pins which will act as vcc and ground and activated on demand
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
#define SERVICE_MESSAGES 0
#define SERVICE_MESSAGES 0
// 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
// Enable this module to use one of the following sensors: SENSOR_ANALOG_INPUT, SENSOR_LDR, SENSOR_THERMISTOR, SENSOR_ML8511, SENSOR_ACS712, SENSOR_RAIN, SENSOR_SOIL_MOISTURE
#define MODULE_ANALOG_INPUT 1
#define MODULE_ANALOG_INPUT 1
// Enable this module to use one of the following sensors: SENSOR_DIGITAL_INPUT
// Enable this module to use one of the following sensors: SENSOR_DIGITAL_INPUT
#define MODULE_DIGITAL_INPUT 1
#define MODULE_DIGITAL_INPUT 1
...
@@ -167,6 +167,8 @@
...
@@ -167,6 +167,8 @@
#define MODULE_BMP280 0
#define MODULE_BMP280 0
// Enable this module to use one of the following sensors: SENSOR_DIMMER
// Enable this module to use one of the following sensors: SENSOR_DIMMER
#define MODULE_DIMMER 0
#define MODULE_DIMMER 0
// Enable this module to use one of the following sensors: SENSOR_RAIN_GAUGE, SENSOR_POWER_METER, SENSOR_WATER_METER