Skip to content

reading i2c sensors #42

@adrianardu

Description

@adrianardu

Hi,
I need some help. I want to read sensor values from a I2C sensor.
I think I need the sysex commands. I tried this:

arduino.pinMode(3, firmata.PIN_MODE_I2C);
arduino.pinMode(2, firmata.PIN_MODE_I2C);
console.log("I2C activated");
arduino.sysex('I2C_CONFIG');
arduino.sysex('I2C_REQUEST, [0x58, 'I2C_READ'], function(x){
arduino.on('sysex', function(e){
console.log("Data: ", e.command);
console.log("data : " + JSON.stringify(e.data));
});

It is not working and I have no idea how to realise the reading.
Thanks

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