Control LED strip on driver station through robot code

This year I am looking to control an LED strip on the driver station based on what is happening in my robot code (we are using Java). Ideally, I would like to make a function such as LEDStrip.setColor(R value, G value, B value); that I can use throughout my code.

Currently, I am trying to find an LED strip to connect to our driver station laptop. I’ve looked around and found that around 2011 there was a FirstTouch I/O module made by Cypress that may have done what I want. However, the board is pretty old and cypress no longer sells them. I’ve also seen a special LED strip called the BlinkyTape that has a LED driver built in, but it runs off Arduino code and is a bit pricy at $50 for 1 meter.

Is there a modern day I/O (output is more important) board that we can connect to our driver station through USB that is supported through Wpi Lib? would it be possible to use something like an Arduino nano or other micro-controller instead? If so how would I communicate with it through the USB on the driver station?

note: This would probably be a lot easier if we put the LEDs on the robot, however, I would like them on the driver station as we may not always be able to see the robot clearly (especially during the sand storm at the start of the 2019 game).

First, unless you make whatever you set up your LEDs with supports controller rumble, I don’t think there’s a good way to do this through WPILib unless you use the same protocol Shuffleboard and SmartDashboard. Even then, I think that would be too much hassle. It’d be easier to have an LED program on the driver station laptop that communicated with the robot.

Once you have that going, you’d have to figure out how to get your computer to communicate with whatever you want to control the LEDs.

If you want to use a raspberry PI, see if it’s possible to split the Ethernet cord to the RPi and the Driver Station (I’m not sure if that’s legal at competition though). If that’s legal, you could communicate directly with the RPi through the robot code.

If you can’t do that, then you could figure out how to get the driver station laptop to communicate with an RPi or Arduino through USB.

I’m not really sure how to do any of this, just throwing some ideas out there.

The IT Launchpad that was included in the KOP a few years ago had DO’s on it. I had it setup to change LEDs based on when auto was over and when there was 30 seconds to go.

http://www.ti.com/tools-software/launchpads/overview.html

You could program an arduino to be a USB HID device (so it shows up as a joystick in the DS) and have it read the force feedback data to change colors. Using an arduino to control the neopixel style LEDs is very easy. adafruit has lots of example code. Just need to have a powerful 5v power supply for the LEDs.

I think this is a pretty cool idea, good for feedback in your peripheral vision!

1 Like

This looks like a promising option, pretty affordable as well from a quick glance. To program this, would you use separate software, then flash it to the board (like an arduino)?
would it just show up as a HID in the robot code?

There is a separate program, but that is included in the update suite iirc. You should be able to access it from LabView utilities labeled as the ‘FRC Gamepad’ tool or something to that effect. (Thats how I’ve done it, you could also probably just use the start menu search feature) and that just flashes it to be an HID

Yes, and assuming you use a TI MSP-EXP430F5529LP, the programmer and HID firmware for the board are included in the NI FRC Update Suite. (Look for the “FRC Gamepad Tool” as BenjaminRowe suggests.)

More info here.

If you have unused FIRST Choice points, the right model is available at FIRST Choice. If not, as you observed, they are pretty inexpensive. (But purchase a few, so you can recover quickly when a student rips the micro-USB connector off of the board the night before a competition!)

Yes; so you can use setOutput() or setOutputs() from your robot code to turn the digital outputs on and off.

Note that without additional circuitry, this solution will allow you to control discrete LEDs (including common cathode RGB LEDs that give you access to the individual R, G, and B elements) but not LEDs that change color based on a strictly timed PWM-type signal (e.g., WS2812s). For the discrete LEDs, you could probably achieve different brightness levels by varying the duty cycle. Also be aware of the max DO current limitation of 100 mA on the LaunchPad.

This sounds like just what I’ve been looking for. I don’t supposed you guys have any suggestions for LED strips do you? You mentioned that this would work for leds that give access to individual R G B elements. Does that essentially mean 5 pins? (power, ground, R, G, B)

One person mentioned using the Arduino on the Driver Station, here’s an example of doing that through a custom dashboard (obviously there are multiple options).
https://www.frclabviewtutorials.com/tutorials/sensors/dashboard/arduino/

For LED strips:

or addressable:

Note that these are 12V - you might want to check out (this is untested):

If you don’t have an Arduino that supports being a HID, we used a python script running on the driver station which monitored the network table and passed the information over serial to the Arduino.