Add ability to inverse notify PIR LED (#765)
This commit is contained in:
3 files changed
+8
-1
No files matched your search
@@ -63,7 +63,7 @@ void MeasureHCSR501() {
|
||||
}
|
||||
}
|
||||
# ifdef HCSR501_LED_NOTIFY_GPIO
|
||||
digitalWrite(HCSR501_LED_NOTIFY_GPIO, pirState);
|
||||
digitalWrite(HCSR501_LED_NOTIFY_GPIO, pirState == HCSR501_LED_ON);
|
||||
# endif
|
||||
if (HCSR501data.size() > 0)
|
||||
pub(subjectHCSR501toMQTT, HCSR501data);
|
||||
|
||||
@@ -33,6 +33,10 @@ extern void HCSR501toMQTT();
|
||||
#define subjectHCSR501toMQTT "/HCSR501toMQTT"
|
||||
//#define HCSR501_LED_NOTIFY_GPIO 4 //Uncomment this line to mirror the state of the PIR sensor to the specified GPIO
|
||||
|
||||
#if defined(HCSR501_LED_NOTIFY_GPIO) && !defined(HCSR501_LED_ON)
|
||||
# define HCSR501_LED_ON HIGH
|
||||
#endif
|
||||
|
||||
#ifndef TimeBeforeStartHCSR501
|
||||
# define TimeBeforeStartHCSR501 60000 //define the time necessary for HC SR501 init
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user