arduino_firmata
arduino_firmata copied to clipboard
reading i2c sensors
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