Hello, I am using the infrared sensor. I have NodeJS checking the proximity every 500 milliseconds. But the numbers seem very random. If I monitor the /sys/class/lego-sensor/sensor1/value0 file, it seems accurate. But the Infrared.getValue(0) does not.
Here my code that is being called every 500 milliseconds:
var ev3dev = require("ev3dev-lang");
var sensor = new ev3dev.InfraredSensor( ev3dev["INPUT_2"] );
sensor.mode = "IR-PROX";
console.log(sensor.getValue(0));
console.log(sensor.proximity);
Any help would be appreciated.
Hello, I am using the infrared sensor. I have NodeJS checking the proximity every 500 milliseconds. But the numbers seem very random. If I monitor the /sys/class/lego-sensor/sensor1/value0 file, it seems accurate. But the Infrared.getValue(0) does not.
Here my code that is being called every 500 milliseconds:
Any help would be appreciated.