|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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?
|
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||||
|
|||||
|
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! Last edited by GeeTwo : 07-08-2016 at 15:04. |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
||||
|
||||
|
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 |
|
#7
|
||||
|
||||
|
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. |
|
#8
|
|||
|
|||
|
Re: LED RGB Lighting
Quote:
Do you externally power the LEDs or use roboRIO power? |
|
#9
|
||||
|
||||
|
Re: LED RGB Lighting
We personally haven't used the DotStars, but we used NeoPixel equivalents in the past. We used one of the 12V to 5V regulators on our 2014 bot to drive them there through a Arduino.
|
|
#10
|
||||
|
||||
|
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.
|
|
#11
|
|||
|
|||
|
Re: LED RGB Lighting
I really think this would be easier to do with an arduino - but that may just be because I've done it before. I believe you got an arduino voucher in the KOP - if you need any help with the programming, just let me know. You should be able to use a simple loop to change the LED colors on the arduino - probably even simple digital out signals to change the program from the roborio.
|
|
#12
|
|||||
|
|||||
|
Re: LED RGB Lighting
In that case, refer back to my post (#4). We used a very similar system using spike relays in 2014 in java; there's no reason it would not work with DIOs using the relay module I listed. (Both the team and I have used these modules with Arduinos.) Using this or a similar 12V relay module with the common ground jumper removed, the DIOs only need to drive a tiny LED on an optoisolator (already ballasted with a resistor on the module), and you can use unregulated 12V to drive the relays and the LEDs. Unless you have an unusually long strip of LEDs, you can power all three colors and the relays off a single PDP breaker.
|
|
#13
|
||||
|
||||
|
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. |
|
#14
|
||||
|
||||
|
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.
|
|
#15
|
||||
|
||||
|
Re: LED RGB Lighting
Quote:
NOTE: I've never used the DotStars before, so this may not be a problem. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|