![]() |
LED RGB Lighting
We are trying to use RGB LEDs on our robot. We want to be able to change the color of all the LEDs when we program it to. We've heard that several teams are using AdaFruit Neopixel LEDs, but they require an arduino to control them. Is there an LED strip that we would be able to power/control just by using the DIO ports on the roboRIO?
|
Re: LED RGB Lighting
When you control the colors, do you want individual LED control or just the strip as a whole? If individual, you're going to need to use something other than DIO. If strip level control is fine, you can hack something together using motor controllers or DIO.
|
Re: LED RGB Lighting
If you're comfortable with the programming, you could attempt to port FastLED to WPILib. I think other teams have also previously been successful with controlling NeoPixels directly from the RIO.
|
Re: LED RGB Lighting
With a 4 channel 12V relay module (e.g. http://www.lightinthebox.com/4-lines...prm=1.2.1.0 ), and an RGB strip of LEDs (e.g. https://www.sparkfun.com/products/12023), it should be straighforward. You would use three DIO ports, one each for red, green, and blue, to control three of the relays, each of which controls power to one of the colors. For this application, you want a "non-addressable" LED strip. This means that all of the LEDs of a given color all go on or off at the same time. Addressable strips would require a microprocessor or a fair chunk of CPU time to send specific colors to specific LEDs on a strip.
Edit: fixed first link. Also, note that I recommend NOT using the ground jumper for a 12V relay module - let the opto-isolator do its job! |
Re: LED RGB Lighting
A slightly more expensive alternative to NeoPixels are Adafruit's own Dotstar lineup. They are slightly more expensive than NeoPixels, and don't come in as many varieties, but just simply use SPI and don't require the specific timing that makes NeoPixels so hard to use with the Rio.
Link: https://www.adafruit.com/categories/885 |
Re: LED RGB Lighting
This year, we used Adafruit APA102 DotStar LED strips controlled off the SPI on the RIO. Incidentally, I'd prefer to use an external device (probably arduino) to not soak up processor time on something which probably isn't as important as actually controlling the robot. However, if you're interested, here's our driver for those from 2016:
https://github.com/RobotCasserole173...sLEDStrip.java |
Re: LED RGB Lighting
Not sure if it helps, but you can use a typical SPI to control the data line for neoPixels.
We did it for the HERO robot controller... https://github.com/CrossTheRoadElec/...ixel%20Example ...basically just make each pixel bit a SPI byte. So if all you have is a SPI, you could get it to work. |
Re: LED RGB Lighting
Quote:
Do you externally power the LEDs or use roboRIO power? |
Re: LED RGB Lighting
Quote:
|
Re: LED RGB Lighting
Our team uses LabVIEW to control the robot. We are looking to just change all the LEDs on the strip to different colors, instead of trying to control each individual LED.
|
Re: LED RGB Lighting
Quote:
|
Re: LED RGB Lighting
Quote:
|
Re: LED RGB Lighting
I also recommend using an Arduino to control the lights. You can easily signal your color changes using I2C or just DIO changes.
An advantage to using a separate co-processor is that you can decouple the lights programming from the rest of the robot development. You can develop and test while the robot or the roboRIO is being used elsewhere. Being carefully mindful of the rules, you might be able to make lights programming part of your off-season training. Or, reprogram the lights after bag-day. |
Re: LED RGB Lighting
We ordered the Adafruit DotStar 32 led strip, and we are having trouble sending data to it over LabVIEW. It is powered through the 5V/2A port on the VRM and is connected to the SCLK, MOSL, and ground ports on the roboRIO. We are currently sending over an array that contains four 255s, 32 sets of 255 , 50, 50, 50 and then four more 0s. Does anyone have a LabVIEW library that already works with the DotStars? Any help would be greatly appreciated.
|
Re: LED RGB Lighting
Quote:
NOTE: I've never used the DotStars before, so this may not be a problem. |
Re: LED RGB Lighting
Quote:
|
| All times are GMT -5. The time now is 20:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi