View Single Post
  #7   Spotlight this post!  
Unread 01-04-2015, 10:53
2538Programming 2538Programming is offline
Registered User
FRC #2538
 
Join Date: Dec 2013
Location: Morris MN
Posts: 3
2538Programming is an unknown quantity at this point
Re: I2C Rangefinders not working

Quote:
Originally Posted by Jefferson View Post
Do you have pull down resistors on the data and clock wires? I believe the arduinos have them built into the board while the roborio needs them added to the bus.
We are using a similar sensor. I'd be happy to send you our C++ library for it.
Also, be careful if you are usng more than one. They can interfere with each other if the readings are sequenced properly.
We have resisters going from 3.5/5 V to SCL and SDA. We are using three of the rangefinders but I am pretty sure they are wired correctly as we were able to get all three values from the Arduino. If you are willing to send me your library, I would love to check it out, thanks!

Quote:
Originally Posted by JDNovak View Post
For the RoboRio, the I2C library changed to 7 bit addressing so the range is 1 to 128 instead of 2 to 254. The default address is 112 to the RoboRio.

The Arduino library uses 8 bit addressing.

I don't think this is officially documented anywhere.

For example I used the Arduino example code to set the address to 4 and then accessed the sensor on address 2 from the RoboRio.

The clock and data do need external 120 ohm pullups also.
This might be the issue, our sensors are addressed at 200, 202, and 204. I will try changing those and get back to you guys. Thanks for responding, I would have never been able to figure that out, why on earth would they do that?
Reply With Quote