Controlling LED's On Driverstation

We recently built a new driver station for our team and it went into use this year. It has a pretty simple analog LED strip that I want to be able to control from the robot code somehow. The general idea would be that instead of it constantly showing the same color, it would be able to mirror the colors that the robot is showing, mostly to look cool.

The two methods I thought of to achieve this would both involve using an Arduino with some transistors to control the LEDs. In the first method the Arduino would communicate with the Driver Station app we currently use, and the LED values would be sent over Network Tables. I’m almost certain this could be done as our dashboard is programmed in JS and JS has the SerialPort API which would allow direct Serial comms with the Arduino.

The second method would be using the Arduino as a USB Human Interface Device and using the setOutput method in the GenericHID class to set the LED colors. This would be more direct, significantly easier to set up, wouldn’t require modifications to existing dashboards (it wouldn’t really need any extra code on the driver station); however, I’ve been looking into it and have not seen any simple examples of using Arduinos for HID Output so it could be a bit of a programming challenge to get it working.

I know about the Launchpad for FRC, but that wouldn’t allow PWM, and I want adjustable brightnesses.

Do any of you have any different ideas or things you have actually done to tackle this problem?

If you want to look into the setOutput() route, this post has a link that includes source code (for an embedded device that is doing HID output for LEDs). It is using a “PSoC” device, but a lot of it is S/W or F/W, and this gives you a pretty good idea what’s involved. This might have enough in it to help you do a targeted search for something similar for Arduino. If you can’t find something close, the first option you mentioned might be easier…

1 Like

If you are looking to use Arduino, there is some discussion on setOutput for Arduino in this thread:

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.