|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
RGB LED Lights
Hey CD! Our team bought these RGB LED Light Strips from AndyMark. Has anyone worked with something like a Raspberry Pi or Arduino to control them? I'm guessing the GPIO Pins on the rPi would work somehow? We might have to convert the 12V LEDs to 5V or something?
Also, is it possible to use the RoboRio to display the Alliance Color if we used these on the robot? I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot? We were possibly thinking of somehow using our DriverStation to provide 5V Power on our control board. Would this be possible if we used a 5V -> 12V converter? On the board is where we probably would use a Raspberry Pi or Arduino. Thank you!! |
|
#2
|
|||
|
|||
|
Re: RGB LED Lights
Quote:
Use of these is fully legal, as long as you don't plug them into motor controllers. For these LEDs, I would recommend using a relay with an Arduino to turn them on and off. Since they're by channel instead of individually addressable, you'll turn on a channel by turning one of the relays on. As for getting the alliance color, WPILib provides a DriverStation API that can tell you what alliance you're currently on. You can then pass this on through I2C, serial, or SPI to the Arduino. |
|
#3
|
||||
|
||||
|
Re: RGB LED Lights
My bad... Yup in section 4.10, R56, it is legal
Quote:
On the robot, can we use the 12V from the battery? |
|
#4
|
||||
|
||||
|
Re: RGB LED Lights
We've used FastLED in the past with success. Power comes through the Arduino so your power source whatever is powering that. We powered ours by plugging it into the RoboRIO's USB although our comm was done over I2C with the built-in Wire Library.
One thing to watch out for if you're doing comm and light updates semi-concurrently is how to wait correctly. If you need to hold a light pattern, don't use millis(). It interferes with retrieving comm data. Use elapsedMillis instead. |
|
#5
|
|||||
|
|||||
|
Re: RGB LED Lights
Quote:
|
|
#6
|
|||||
|
|||||
|
Re: RGB LED Lights
We used a similar string of LEDs to show alliance colors in 2015, using spike relays controlled directly from the RIO. See this post for the details.
|
|
#7
|
||||
|
||||
|
Re: RGB LED Lights
In 2016 we used those on our bot. We used the FastLED library on an arduino to send them the signals. But we also sent the arduino PWM signals to tell the arduino what color to display. The driver station has a way to get your alliance color and we sent that to the arduino for that purpose. But mainly we had a rainbow animation on them which is this video. If you want to know more DM me and I'll put you in contact with the person who wrote the code and developed the system for it.
![]() |
|
#8
|
|||
|
|||
|
Re: RGB LED Lights
Yes, you could pull a run directly from a PDP breaker, or wire something off the VRM (and you can add a second VRM if needed for this purpose), or you could even use a solenoid relay from the PCM assuming you're using 12 volt pneumatics and not 24 volt.
Last year on our robot our green LED ring light for autonomous vision processing was powered from the PCM, since our VRM outputs were used by other devices (we had a webcam, and a Raspberry Pi running the webcam and vision processing software, and a D-Link gigabit network switch on board since the OpenMesh radio only has two available ports). This also lets you turn it on and off in software, whereas the VRM output is always on. As a cheap and easy way to set up LED lights (non addressable, non controllable) we were looking at IKEA DIODER light strips. We would have run these off a PCM relay output or VRM output. |
|
#9
|
|||
|
|||
|
Re: RGB LED Lights
We run our RGB strips, ringlight, and targetting flashlight off of the roborio using PWM and a mosfet circuit based on a sample from adafruit. Very clean and simple.
Here's the adafruit link: https://learn.adafruit.com/rgb-led-strips/usage Here's the rough circuit design. The green blocks are terminals. Last edited by BenBernard : 22-12-2016 at 19:31. |
|
#10
|
||||
|
||||
|
Re: RGB LED Lights
In 2015 we had common-anode LED strips on the forklift verticals, and drove them through MOSFETs connected to the RoboRIO PWM ports. (We switched to CAN bus Talon SRXes, so our PWMs were totally unused.)
We were reminded (the hard way) that the PWM ports are shut off as part of the safety interlock when the robot is disabled. The plan in 2016 was to use the Adafruit I2C PWM driver instead, assuming the I2C port isn't shut off when disabled. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|