Log in

View Full Version : Roborio to Arduino over PWM


Technologyman00
28-07-2016, 22:30
Hi!

My FRC team and I are currently working on camera tracking for off-season events and the upcoming years. We are going to be using a Pixy camera for our camera tracking because it handles most of the camera tracking code meaning out I2C is taken by the Camera, But we also want to have a NeoPixel Light Ring controlled by an Arduino so we had to use PWM to communicate with the Arduino. The Arduino is controlling our Ring Light incase we need to change color and just for show.

Github Link: https://github.com/Technologyman00/Roborio-to-Arduino-Light-Control

If you have any questions feel free to ask I want this to be a resource for other teams to use!

-Collin

nickbrickmaster
28-07-2016, 23:46
This is very interesting. Not the first thing that I would have thought of for rio-arduino communication. The roboRIO has a second I2C on the MXP, but I can understand not breaking that out. However, I2C can have multiple devices connected as a bus, allowing one to connect multiple slave devices (Arduino, Pixy) to a single master (or even multiple!). Just a note :)

This is super unique and it's obvious that some good problem solving was had. How did you do it on the roboRIO end?

Technologyman00
29-07-2016, 12:48
So on the Roborio side we used AnalogOutput to send a single number over PWM to the Arduino. And because of how the Light Ring works it only has to be sent once to the Arduino because it will display the same color until told otherwise.