Just tried out the HC-SR04 module. As soon as require("HC-SR04").connect(...) is called the sensor fires off and logs the distance - without waiting for sensor.trigger().
I suggest to correct the module code to include trig.write(0) as the first line.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just tried out the HC-SR04 module. As soon as
require("HC-SR04").connect(...)
is called the sensor fires off and logs the distance - without waiting forsensor.trigger()
.I suggest to correct the module code to include
trig.write(0)
as the first line.