Fix for HCSR501

I found some issue with HCSR501 code, hope you add fix soon

config_HCSR501.h

#define HCSR501_PIN D5 , should be PIN number instead of D5

ZsensorHCSR501.ino

Missing timehcsr501 for calculating inverval between sending data, so device will send data continuously

//Time used to wait for an interval before resending data from hcsr501
unsigned long timehcsr501 = 0;

void MeasureHCSR501(){
  if (millis() > (timehcsr501 + TimeBeforeStartHCSR501)) {//let time to init the PIR sensor
  timehcsr501 = millis();

Hope you fix soon

1 Like