Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   I2C working on RoboRIO (http://www.chiefdelphi.com/forums/showthread.php?t=131658)

taichichuan 21-12-2014 23:06

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.

DavidBlain 31-12-2014 16:57

Re: I2C working on RoboRIO
 
We would be interested in the code. do you have a link?

taichichuan 01-01-2015 19:29

Re: I2C working on RoboRIO
 
Quote:

Originally Posted by DavidBlain (Post 1418547)
We would be interested in the code. do you have a link?

Yes, here is the link to a copy on my dropbox:

https://dl.dropboxusercontent.com/u/...7/ADXL-I2C.zip

HTH

mannybjh 10-01-2015 14:13

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.

taichichuan 10-01-2015 14:31

Re: I2C working on RoboRIO
 
Quote:

Originally Posted by mannybjh (Post 1425645)
Did you experience any issues with this? Trying to get info on it, not helping.

I'm sorry, I don't understand what you're asking here. The code is available from the link listed earlier in this thread.

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

taichichuan 06-04-2015 20:53

Re: I2C working on RoboRIO
 
1 Attachment(s)
Quote:

Originally Posted by taichichuan (Post 1418931)
Yes, here is the link to a copy on my dropbox:

https://dl.dropboxusercontent.com/u/...7/ADXL-I2C.zip

HTH

Here is a copy for posterity.

HTH,

Mike

The Doctor 04-02-2016 16:59

Re: I2C working on RoboRIO
 
Quote:

Originally Posted by taichichuan (Post 1418931)
Yes, here is the link to a copy on my dropbox:

https://dl.dropboxusercontent.com/u/...7/ADXL-I2C.zip

HTH

Link is broken.

taichichuan 04-02-2016 18:31

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

Joe Ross 05-02-2016 16:27

Re: I2C working on RoboRIO
 
Quote:

Originally Posted by taichichuan (Post 1425659)
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.

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?

taichichuan 05-02-2016 17:13

Re: I2C working on RoboRIO
 
Quote:

Originally Posted by Joe Ross (Post 1535651)
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?

There shouldn't be. But, I haven't revisited this with the 2016 WPILib as of yet. If it works out of the box, please post that so others will benefit as well.

Thanks,

MikeA


All times are GMT -5. The time now is 08:41.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi