You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi - I'm afraid the GH-311 isn't really very useful at all. I've just googled it and it gives a single output: High when you're near to it, and Low when you're far away - there is no distance measurement.

    So you can't use it with the HC-SR04 driver... The best you could do is:

    setWatch(function(e) {
      if (e.state) console.log("In Range");
      else  console.log("Out of Range");
    }, SENSOR_PIN, { repeat: true });
    
About

Avatar for Gordon @Gordon started