Help with RGB Lighting on Robot

I have a few question regarding this. How would one add RGB lighting in the begin.vi? That is the simple question. The next question is, how would set the lights on a timer, or, more preferably, make the lights change colors based on field prompts. To explain myself, there has to be some kind of signal sent to the robot to distinguish between when the robot is idle and when it is functioning. How would I take advantage of this (if it exists and I am not just retarded) to make the RGB LED’s change color?

This will depend entirely on which kind of RGB LEDs you choose. In the simplest form, an RGB LED is just a 4 terminal device (R, G, B and common/power). If you wish to control one LED, you’d need 3 digital I/Os.

I assume you want to do something more interesting, like use an individually-addressable RGB strip. This allows you to control the color of each pixel independently and you can do some cool stuff. We used these on our robot last year and they work pretty great:

https://learn.adafruit.com/adafruit-neopixel-uberguide/overview

The downside is that they require an Arduino to control the lights since they use a special PWM-style 1-wire interace with tight timing requirements. We used 4 digital I/Os from the cRIO to signal the Arduino when robot functions happened and then the Arduino code adjusted the light pattern it displayed to the light strips.

However, Adafruit recently released some nifty new strips that can be configured using SPI (an interface you have on your RoboRIO).

http://www.adafruit.com/products/2240

The complication here is that you’d need to program your own control code to display something interesting to your lights that will share processing time with your robot functions.

I’d recommend the Arduino-controlled approach since it greatly simplifies the firmware development effort since they are tons of examples online on how to program these strips.

Cool, thanks for the ideas. I don’t have much experience with Arduinos, so I have a couple of questions. Could we program the Arduino in Labview, if not, what language? And, does what would we use to power the Arduino?

The arduinos are programmed using C. Lots of documentation can be found all over the internet. A good place to start either the arduino website or AdaFruits learning system, which has alot of information on the RGB lights they sell and how to hook them up to an arduino. That was linked in the post above.

As for power, I think the easiest way to power an arduino this year is to just plug it straight into the USB ports on the RoboRIO. This will allow an easy communication method between the 2 devices, and makes it so you do not have to solder any wiring. Just be sure if you do this to NOT power the lights off of that power supply, and instead use a separate 12v to 5v converter to power the lights.

Cool. Thanks for everything.

REV Robotics has the RIOduino, an Arduino-compatible board, that can plug directly into the MXP on the roboRIO.

The RIOduino operates exactly like an Arudino Uno R3 but with a few added features that tailor it to the roboRIO and an FRC robot. For example:

  • Three auto selecting power options: USB, MXP, or externally (e.g. VRM)
  • Place to attach RGB LED strips directly (with external power)
  • I2C and UART already connected to the roboRIO (for communication)

We tried to make it as easy as possible to connect an Arduino to the roboRIO so you could get right to programming it rather than figuring out how to connect it. The great thing is you can use the vast ecosystem of Arduino examples on the RIOduino and get something working very fast.

The RIOduino is an approved active MXP board and is available now at AndyMark. Take a look at the documentation on our website: www.revrobotics.com/product/rioduino for more info on its various features.

-David

Our team used an Arduino and some individually-addressable RGB lights on last year’s robot. We used some of the digital IO pins from the cRIO that told the Arduino which of the pre-programmed light patterns to run. The cRIO would also tell the Arduino our alliance color so the lights could display a red or blue pattern.