|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
I2C Rangefinders not working
We are using maxbotics mb1212 I2C rangefinders and we have tested our rangefinders on an arduino but for some reason, the same approach to reading off the sensors seems to fail. I think our issue may be that it can't find the sensors, which it should totally be able to do, or that it has trouble accessing the command on the sensors. The documentation for the rangefinders is right here http://www.maxbotix.com/documents/I2..._Datasheet.pdf
,as well our Rangefinder code: Quote:
|
|
#2
|
|||
|
|||
|
Re: I2C Rangefinders not working
Quote:
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. |
|
#3
|
||||
|
||||
|
Re: I2C Rangefinders not working
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. |
|
#4
|
|||||
|
|||||
|
Re: I2C Rangefinders not working
According to page 15 of the RoboRIO user manual,
Quote:
|
|
#5
|
|||
|
|||
|
Re: I2C Rangefinders not working
Perhaps you are mixing up this value with CAN termination resistors? That's a very strong pull for I2C. Also, not needed on roboRIO for I2C.
|
|
#6
|
||||
|
||||
|
Re: I2C Rangefinders not working
The Arduino I2C library doesn't enable internal pullups so I had to install them to test and set the addresses. I think they are 1.2K instead of 120 ohm. My mistake.
I left them installed on the network when I moved to the roboRIO and they worked with both the main and MXP I2C ports. I had a scope on them at some point and the roboRIO drove the lines low enough. Somehow I missed the users manual so thanks for the link. |
|
#7
|
|||
|
|||
|
Re: I2C Rangefinders not working
Quote:
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|