@ -32,7 +32,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_DHT22
# include "sensor_dht22. cpp "
# include "sensor_dht22. h "
Sensor_DHT22 sensor_dht22 ( SENSOR_DHT22_PIN ) ;
# ifndef SENSOR_DHT22_temperature_minchange
@ -58,7 +58,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_BMP180
# include "sensor_bmp180. cpp "
# include "sensor_bmp180. h "
Sensor_BMP180 sensor_bmp180 ;
# ifndef SENSOR_BMP180_temperature_minchange
@ -83,7 +83,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_HTU21D
# include "sensor_htu21d. cpp "
# include "sensor_htu21d. h "
Sensor_HTU21D sensor_htu21d ;
# ifndef SENSOR_HTU21D_temperature_minchange
@ -110,7 +110,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_SHT31
# include "sensor_sht31. cpp "
# include "sensor_sht31. h "
Sensor_SHT31 sensor_sht31 ;
# ifndef SENSOR_SHT31_temperature_minchange
@ -136,7 +136,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_HS1101
# include "sensor_hs1101. cpp "
# include "sensor_hs1101. h "
Sensor_HS1101 sensor_hs1101 ( SENSOR_HS1101_PIN ) ;
# ifndef SENSOR_HS1101_humidity_minchange
@ -152,7 +152,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_BH1750
# include "sensor_bh1750. cpp "
# include "sensor_bh1750. h "
Sensor_BH1750 sensor_bh1750 ;
# ifndef SENSOR_BH1750_light_minchange
@ -167,7 +167,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_ML8511
# include "sensor_ml8511. cpp "
# include "sensor_ml8511. h "
Sensor_ML8511 sensor_ml8511 ( SENSOR_ML8511_PIN ) ;
# ifndef SENSOR_ML8511_minchange
@ -183,7 +183,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_HCSR501
# include "sensor_hcsr501. cpp "
# include "sensor_hcsr501. h "
Sensor_HCSR501 sensor_hcsr501 ( SENSOR_HCSR501_PIN ) ;
# ifndef SENSOR_HCSR501_senddelaymax
@ -195,7 +195,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_RADAR
# include "sensor_radar. cpp "
# include "sensor_radar. h "
Sensor_Radar sensor_radar ( SENSOR_RADAR_PIN ) ;
# ifndef SENSOR_RADAR_senddelaymax
@ -207,7 +207,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_LDR
# include "sensor_ldr. cpp "
# include "sensor_ldr. h "
Sensor_LDR sensor_ldr ( SENSOR_LDR_PIN ) ;
# ifndef SENSOR_LDR_minchange
@ -259,7 +259,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_SDS018
# include "sensor_sds018. cpp "
# include "sensor_sds018. h "
Sensor_SDS018 sensor_sds018 ( SENSOR_SDS018_SERIAL_RX , SENSOR_SDS018_SERIAL_TX ) ;
# ifndef SENSOR_SDS018_PM10_minchange
# define SENSOR_SDS018_PM10_minchange 10.0
@ -282,7 +282,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_TCS34725
# include "sensor_tcs34725. cpp "
# include "sensor_tcs34725. h "
Sensor_TCS34725 sensor_tcs34725 ;
# ifndef SENSOR_TCS34725_LUX_minchange
# define SENSOR_TCS34725_LUX_minchange 500
@ -305,7 +305,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_VL53L1X
# include "sensor_vl53l1x. cpp "
# include "sensor_vl53l1x. h "
Sensor_VL53L1X sensor_vl53l1x ;
# ifndef SENSOR_VL53L1X_minchange
# define SENSOR_VL53L1X_minchange 100
@ -321,10 +321,11 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_ANEMOMETER
void ICACHE_RAM_ATTR interrupt_anemometer ( ) ;
# include "sensor_anemometer.cpp"
//Sensor_Anemometer_Instance = new Sensor_Anemometer(SENSOR_Anemometer_PIN);
Sensor_Anemometer sensor_anemometer ( SENSOR_Anemometer_PIN ) ;
void ICACHE_RAM_ATTR interrupt_anemometer ( )
{
if ( millis ( ) - sensor_anemometer . anemometer_lastpulse_fordebounce > = ANEMOMETER_DEBOUNCETIME ) { //ignore if pulse came too fast
@ -333,6 +334,9 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
}
}
# ifndef SENSOR_Anemometer_minchange
# define SENSOR_Anemometer_minchange 0.25
# endif
@ -345,12 +349,14 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# endif
# ifdef SENSOR_RAINGAUGE
//uses ATS177 Latched Hall Sensor for rauge flip sensing
void ICACHE_RAM_ATTR interrupt_raingauge ( ) ;
# include "sensor_raingauge.cpp"
Sensor_Raingauge sensor_raingauge ( SENSOR_Raingauge_PIN ) ;
void ICACHE_RAM_ATTR interrupt_raingauge ( )
{
if ( millis ( ) - sensor_raingauge . raingauge_lastpulse_fordebounce > = RAINGAUGE_DEBOUNCETIME ) { //ignore if pulse came too fast
@ -374,7 +380,7 @@ HomieNode sensorNode("sensors", "Sensors","sensors"); //id, name, type
# ifdef SENSOR_MULTICHANNELGASGMXXX
# include "sensor_multichannelgasgmxxx. cpp "
# include "sensor_multichannelgasgmxxx. h "
Sensor_MULTICHANNELGASGMXXX sensor_multichannelgasgmxxx ;
# ifndef SENSOR_MULTICHANNELGASGMXXX_no2_minchange