|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
I2C working on RoboRIO
Today's effort was trying to get the I2C working on the RoboRIO. Evidently, the on-board I2C port is /dev/i2c-2 (that's the 3rd port of 3). We wanted to get a generic example of I2C code that could be extended to use any of the dozens of I2C sensors available from places like Sparkfun.
We first got a Linux only program running to prove the port was working at all. Then we ported the application to WPILib. The device was a Sparkfun ADXL345 3-axis accelerometer. Anyone interested in the code is welcome to a copy of both the Linux version and the WPILib version. Drop by https://www.facebook.com/FRC2015ControlsBeta for a look at the hook up. |
|
#2
|
|||
|
|||
|
Re: I2C working on RoboRIO
We would be interested in the code. do you have a link?
|
|
#3
|
||||
|
||||
|
Re: I2C working on RoboRIO
Yes, here is the link to a copy on my dropbox:
https://dl.dropboxusercontent.com/u/...7/ADXL-I2C.zip HTH |
|
#4
|
||||
|
||||
|
Re: I2C working on RoboRIO
Did you experience any issues with this? Trying to get info on it, not helping. Also, how did you find the addresses for it all. Like knowing to send to port 16 ect.
Last edited by mannybjh : 01-10-2015 at 02:26 PM. |
|
#5
|
||||
|
||||
|
Re: I2C working on RoboRIO
Quote:
You can see a picture of how it was connected at https://www.facebook.com/FRC2015ControlsBeta . Note that this is the Sparkfun ADXL345 board -- not the one found in previous KoP deliveries! For the KoP sensor, use the provided WPILib classes. Our I2C example code was just a way to demonstrate I2C on the RoboRIO from start to finish. HTH |
|
#6
|
||||
|
||||
|
Re: I2C working on RoboRIO
Quote:
HTH, Mike |
|
#7
|
||||
|
||||
|
Re: I2C working on RoboRIO
Quote:
|
|
#8
|
||||
|
||||
|
Re: I2C working on RoboRIO
You can pick it up from the message just above it where I attached the zip file to the message.
HTH, Mike |
|
#9
|
||||||
|
||||||
|
Re: I2C working on RoboRIO
This year, the ADXL345_I2C class was updated to take alternate address, like the Sparkfun board uses. Is there another reason the WPILib classes don't work?
|
|
#10
|
||||
|
||||
|
Re: I2C working on RoboRIO
Quote:
Thanks, MikeA |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|