-
Notifications
You must be signed in to change notification settings - Fork 92
Version 0.1.0 not working #4
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
Comments
I'm now using this for the constructor: |
Can you post your code from #1 with all the changes for 0.1.0? |
I'm now using this: var i2c = require('i2c'); //using in 0.0.5 |
I think you need: var wire = new i2c(4, {debug:false, device:'/dev/i2c-1'}) // 4 is the address for your arduino
wire.writeBytes(0x00, "RSI", function(err) {}); the first argument in writeBytes is a command byte which is required by the i2c-dev interface. |
Yup, that works. I thought that was the address, that is assigned to the RPi. The first argument is BTW also send to Arduino, so it seems that the i2c-dev doesn't do anything with it. |
Sweet! Most i2c device communication is a command, followed by a series of bytes. So, it's a little awkward in your case. I may try to abstract that bit in the code. So you could just pass in two or three arguments. In the meantime, this should work: wire.writeBytes("R", "SI", function(err) {}); in the next release, this will work: wire.writeBytes("RSI", function(err) {}); |
Yup, I thought of that workaround already as well. And it isn't really strange to do it, as it is my current way of telling, what I want to do and then send the arguments. Thx for the help! |
If I use my code from #1 and change it to the new writeBytes nothing happens at all, no clue at what is wrong.
The text was updated successfully, but these errors were encountered: