Skip to content

Infrared Sensor PROX #25

@codeadamca

Description

@codeadamca

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions