|
|
|
| My crate or yours? |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Gyroscope -> Arduino -> RoboRIO
We're trying to use a Gyroscope on our robot this year. The gyroscope we're trying to use is the Adafruit BNO055. So far, the way we're found to get information from it is with an Arduino Driver that adafruit provides. So naturally we are trying to get the data from the gyroscope with an arduino, and then trying to pipe it to the RoboRIO.
We got the arduino to read the Gyroscope no problem. But now we're trying to get the arduino to pipe the data to the RoboRIO via the I2C bus. We threw some code together, for both the RoboRIO side of things, and the Arduino side of things. So the trouble is, we don't know how to use the Wire library on the Arduino to send the gyroscope values back to the RoboRIO when it asks for them. We got the RoboRIO to send over data to the Arduino, telling it what to send, but we can't get the arduino to send anything back. When sending data back to the RoboRIO(the master) device, do we need to specify the address of the device? Asking since the Arduino acts as the master device to the Gyroscope, but a Slave device to the RoboRIO. We've tried the I2C address scanner code to try and find the address for the roborRIO that way. But then we found that there was a board from Rev robotics called the RIODuino, which has example code using the I2C bus. So we found that the examples used the address of 84. We tried telling the Wire library to begin a Transmission with device 84, but that made the Arduino sketch crash. Is it worth it to try and write our own Driver for the Gyroscope and remove the Arduino middle man altogether? |
|
#2
|
|||
|
|||
|
Re: Gyroscope -> Arduino -> RoboRIO
Buy a NavX, avoid the headache altogether. One of the best controls investments your team can make.
|
|
#3
|
||||
|
||||
|
Re: Gyroscope -> Arduino -> RoboRIO
This year we tried to use an Arduino to send gyroscope and acrostic pinger values to the roboRIO. Using a formatted serial.out() we could pull the separate values out using a VISA read. If you're using LabVIEW, I can post some sample code we are using for autonomous when I get home.
|
|
#4
|
|||
|
|||
|
Re: Gyroscope -> Arduino -> RoboRIO
I've used the BNO055 on some personal projects involving a cRIO - here's the "driver" I wrote for talking to it (mostly based on Adafruit's python library): https://github.com/4ndr3w/BallBot/bl...ter/BNO055.cpp
Some notes if you move forward with something based on this:
EDIT: Just wanted to tack on that there are a ton of COTS gyro solutions that let you avoid headache, like Oblarg said: - WCP's Spartan board with the ADXRS450 gyro (we use) - CTRE's Pigeon IMU - NavX - If you're just looking to do some simple gyro turns/drive straight in auto, you could use an analog gyro and be pretty safe Last edited by Andrew Lobos : Today at 15:17. |
|
#5
|
||||
|
||||
|
Re: Gyroscope -> Arduino -> RoboRIO
I'm curious, if you are already using i2c, why not interface to the sensor directly?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|