We are trying to using Arduino with the roboRIO in c++. We are calculating position of the robot using three sensors (2 encoders and a NavX-mxp sensor) using Arduino. We then want to connect Arduino to the roboRIO so we can read the robot’s position from LabView. Also, we are communicating with the roboRIO via wifi. We would appreciate it if you can help us!
We didn’t have a ton of experience with LabView, so we thought it would be easier to do everything using Arduino and just send the value of position to the roboRIO
I recommend plugging the NavX into the roborio. Here is the library and guide on how to use
For encoders, you can plug into DIO pins, plug them into a Talon SRX, or plug them into a CANifier
And a guide:
CTRE has very good documentation on how to use their stuff. Communicating with an Arduino is not exactly trivial. There are many ways to do it, including I2C, using digital IO, SPI, but there are pros and cons for each.
In addition to the library, there is a separate download containing utilities and sample projects. It includes several sample robot projects that use the trajectory library. (Note - That sample5, which is a swerve drive, works, but is still a work in progress. Specifically, there are issues with reverse trajectory execution.)
To answer the original post, if you want to go that direction: the arduino Wirelibrary allows you to communicate via i2c, which you could use to talk to the rio. You could also use Seriallibrary via the rs-232 rio port, or the SPIlibrary in the spi port.