-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to read bytes from I2C arduino #151
Comments
I'm assuming you have an Arduino running StandardFirmata (or one of the variants) connected to a computer running firmata.js and then a second Arduino acting as an I2C slave connected the Arduino running StandardFirmata, right? The first thing I suspect is that 500ms delay is messing things up so remove that from your Arduino code since it's blocking and unnecessary. |
Using exactly the arduino slave code you provided, I created the following program: var Board = require("firmata");
Board.requestPort(function(error, port) {
if (error) {
console.log(error);
return;
}
var board = new Board(port.comName); // no change to sampling interval
board.on("ready", function() {
this.i2cConfig();
this.i2cRead(8,4, function(data) {
console.log("received data");
console.log(data);
});
});
}); Which produces the following results:
When I added
|
I'm trying to read bytes from an slave arduino. But i'm unable to get the correct bytes values.
The slave arduino code:
The Firmata code:
The response i get is:
The text was updated successfully, but these errors were encountered: