Fix for HCSR501

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


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


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

This s not fixed in 0.9.2beta. Hope you add soon

Hello Tran,

Maybe you could submit a pull request for that?