Add support for HC-SR04 sensor (#453)

Adds support for HC-SR04 Ultrasonic distance snsor.
This commit is contained in:
mpember authored and Florian committed 2019-09-10 20:38:04 +02:00
1 parent e4683b1812
commit 30ff181a57
5 files changed
+150

No files matched your search

+12
View File
@@ -84,6 +84,9 @@
#ifdef ZsensorBME280
#include "config_BME280.h"
#endif
#ifdef ZsensorHCSR04
#include "config_HCSR04.h"
#endif
#ifdef ZsensorDHT
#include "config_DHT.h"
#endif
@@ -605,6 +608,9 @@ void setup()
#ifdef ZsensorHCSR501
setupHCSR501();
#endif
#ifdef ZsensorHCSR04
setupHCSR04();
#endif
#ifdef ZsensorGPIOInput
setupGPIOInput();
#endif
@@ -887,6 +893,9 @@ void loop()
#ifdef ZsensorBME280
MeasureTempHumAndPressure(); //Addon to measure Temperature, Humidity, Pressure and Altitude with a Bosch BME280
#endif
#ifdef ZsensorHCSR04
MeasureDistance(); //Addon to measure distance with a HC-SR04
#endif
#ifdef ZsensorBH1750
MeasureLightIntensity(); //Addon to measure Light Intensity with a BH1750
#endif
@@ -992,6 +1001,9 @@ void stateMeasures(){
#ifdef ZsensorBME280
modules = modules + ZsensorBME280;
#endif
#ifdef ZsensorHCSR04
modules = modules + ZsensorHCSR04;
#endif
#ifdef ZsensorBH1750
modules = modules + ZsensorBH1750;
#endif