![]() |
Question about I2C Communication
Hello everyone.
I wanted to see if someone here knows how to set up I2C to connect to an Arduino. Right now we've been able to write to the Arduino, but we have not found a way to read from it. If anyone can help us, we'd appreciate it. |
Re: Question about I2C Communication
In what way is the I2C Read function failing to work for you?
|
RoboRIO can't read from the Arduino.
I tried switching between on-board and the MXP pins, but no luck so far |
Re: Question about I2C Communication
To have a good chance of figuring out what might be wrong, we'll need a whole lot more information about your system. Tell us what you're doing, exactly what you expect to happen, and exactly what happens instead. Be as specific and as detailed as possible. Don't summarize or leave out anything you might not think is important. Better to give us too much than too little.
Seeing your code would help. Seeing a picture of your wiring would be good too. |
Question about I2C Communication
1 Attachment(s)
Quote:
What we're trying to do is control a LED strip with an Arduino. The RoboRIO will send the Arduino an RGB value which will then be used to control the LED strip. At certain points controlled by us, the RoboRIO will "ask" the Arduino what it current RGB values are. This last bit is what we've been having trouble with, because the Arduino gets the message from the RIO, but when it sends the RGB values back the RIO doesn't read them. This is the receive code inside LabVIEW: Attachment 18044 Note that we know the current address is 0, that was just for testing purposes. At the moment I can't take a picture of the wiring. |
Re: Question about I2C Communication
Would help to see your Arduino code as well.
|
Question about I2C Communication
This is our current Arduino code:
Code:
|
Re: Question about I2C Communication
Where did you get that Arduino code? The examples I have seen for an Arduino I2C "slave" use the Wire.onRequest() method to register an event handler that sends the data.
|
Question about I2C Communication
Quote:
We took a "Master write" example from the Arduino website and modified it a bit. I hadn't thought about onRequest(). Maybe that's our mistake? |
Re: Question about I2C Communication
Quote:
|
Quote:
Right, I didn't think about that before.... I'll test it tomorrow and see what happens. Thanks for your help |
Quote:
Thanks for your help, we got I2C working. |
Re: Question about I2C Communication
Can you share your LabVIEW write I2c code as well?
|
| All times are GMT -5. The time now is 08:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi