Pixy(CMUcam5) to RIOduino

So right now our team is trying to figure out if its possible to wire a Pixy camera to a RoboRio by going through a RIOduino instead of a arduino that way it could be simply plugged into the RoboRio. However we are having trouble in finding a way, if its possible/worth it. I just wanted to ask if anybody has any advice in doing this.

The RIOduino is pretty much an arduino with an MXP header if I recall correctly. Its default behavior is probably to be an i2c slave, which might cause trouble trying to read another device.

You could also hook it directly to the RIO’s i2c, SPI, or USB ports. The downside to this is having to write your own driver code, but you can probably find some code another team has written for this.

I haven’t used the RIOduino before but it does appear to be an Arduino with an MXP header, they even advertise it as such.
Communicating with the Pixy via the SPI interface should work using pretty much just Pixy SPI Arduino example code. It should not interfere with I2C/UART comms with the RoboRIO.

I’ve used the RIODuino before, for controlling LEDs. UART/Serial should work just fine. Not sure about anything else, as I haven’t used those.

For vision this past year we used a regular arduino and a pixy. Pixy into arduino over SPI (ICSP) and then UART to the roboRIO. We actually started out using digital IO, a pin for left, one for right, and one for straight for peg alignment. While it was very primitive, even that worked well enough. UART was more flexible. We just sent over error values (in + pixels for right or - pixels for left) and the Rio pretty much did all of the logic from there with PID.

As far as rioduino, I suspect you can do a similar thing if you are able.to configure the connection to the roboRIO to he over serial. If it’s set up as an I2C slave and can’t be changed, maybe try using UART for the pixy. Check the documentation, as off the top of my head it is possible to connect the pixy to the arduino over UART.

We’ve used the Pixy for 2 seasons now and connected it directly to the RoboRIO both times. In Stronghold we used 1 Pixy and the analog/digital X interface. Last season we used 2 of the Pixy sensors (one gear, one boiler) with both on a single I2C interface to the RoboRIO.

I’m not sure what an intermediate microcontroller does for you.

We also used two Pixys through I2C this past season. The diagrams below show how we wired it.

Here is a link to our GitHub account if you want to see the code used: https://github.com/FRC-Team1746/Steamworks-v1.0

I can point our programming team in this direction if you have any other questions.

https://lh3.googleusercontent.com/T7eh448pHE21dViLwW0HV4BphvVK0Al2fZPPNPkHFxW0gbsDHZEPaHJ1Glcc_u9hZQWIhQWXpZMx9szgV97Vh5LWABG19-K7FKLsKkEIqBbkOaFoG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OgTjx2KFu1Q29ODpx3K1qnkw67Lh8twqXaLNqDj2aqbO6ZKf6jAGWqUp5XIZRQ=w489-h334-no

As Ken indicated Team 230 used the Pixy the last 2 years without any intervening arduino or other controller. Our C++ code* that facilitated the I2C interface we used last year (2017) can be found here: FRC-team230-2017 / SVN / [r89]

(*Note that this code was based on code posted on CD last year by Team 599).

Our C++ code we used to interface to the analog\digital interface in 2016 is here: FRC-team230-2016 / Code / [r123]

Feel free to contact me if you have any questions.

I am curious here. I bought a Pixy cam to put on a Lego Mindstorm a while back for “coolness” effect for recruiting purpose. I did not realize that it would work well in a FRC context. I could change the firmware load to use it with standards micro-controllers. Is there a color of lighting that provides a better Hue than others? I way get the team to experiment this fall. This would save us the raspberry pi additional hardware.