Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   How to use an RGB LED strip with a Vex Spike? (http://www.chiefdelphi.com/forums/showthread.php?t=134467)

Samwise_T 12-02-2015 21:03

How to use an RGB LED strip with a Vex Spike?
 
My team wants to put an RGB LED strip on the robot, and we have some Vex Spike relays to use (I've heard these would work, not sure). Our LED strip has a common anode, so one wire to take an input voltage, and then one wire for each cathode of the LEDs, so one wire for red, one for blue, and one for green. Our Vex Spikes have a Voltage in, ground, and PWM input, and then a M+ and M- output. How would I wire the LED strip with one (or a few) of these relays in order to control the light color? So far I've tjougjt of using one relay per LED cathode, but I'm not sure what to do with the remaining + wire. Any help would be greatly appreciated.

GeeTwo 12-02-2015 21:17

Re: How to use an RGB LED strip with a Vex Spike?
 
We just did this with two spikes, also with a common +12 and separate 0V lines.

We wired the red, green, blue, and black (common) to the four outputs of two spikes, then set the values to high or low as needed. If you do this, you will need not only to use kForward (+ is positive, - is negative) and kReverse (- terminal is positive, + is negative), but also kOn (both positive) and kOff (both negative). I'll post a truth table for this in a few minutes...

GeeTwo 12-02-2015 21:24

Re: How to use an RGB LED strip with a Vex Spike?
 
Even better, here is our FunLights class (in Java) posted after this evening's build. We don't have the lights working properly, but we're pretty sure it's in how these methods are being called, not in this class.

It didn't get recorded in the code, but it looks like we wired
  • Red: Spike 1, + terminal
  • Grn: Spike 1, - terminal
  • Blu: Spike 2 + terminal
  • Blk: Spike 2 - terminal

Samwise_T 12-02-2015 21:29

Re: How to use an RGB LED strip with a Vex Spike?
 
So by "red" do you mean the red (positive) wire, or the wire for the red LED? Our 4 pins are labeled +, B, R, and G.

GeeTwo 12-02-2015 21:36

Re: How to use an RGB LED strip with a Vex Spike?
 
Quote:

Originally Posted by Samwise_T (Post 1442902)
Our Vex Spikes have a Voltage in, ground, and PWM input, and then a M+ and M- output.

Glad I went back and re-read this. Spike relays do NOT have a PWM input. The connector is the same, but the signals are VERY different - so different that I wish they didn't have the same pins. The Spike relays must be connected to a RELAY port on the 'RIO, not the PWM port. The black is ground on both PWM and RELAY, but on RELAY the red and white wires are both data lines that may be at either 0V or 5V. For PWM, the red line is at a constant 5V, and the white line switches back and forth rapidly to provide control.

GeeTwo 12-02-2015 21:38

Re: How to use an RGB LED strip with a Vex Spike?
 
Quote:

Originally Posted by Samwise_T (Post 1442917)
So by "red" do you mean the red (positive) wire, or the wire for the red LED? Our 4 pins are labeled +, B, R, and G.

My bad assumption -- On ours, the wires were color coded:
  • +: black
  • R: red
  • G: green
  • B: blue

Samwise_T 12-02-2015 21:41

Re: How to use an RGB LED strip with a Vex Spike?
 
That makes sense, thank you. I've always just associated black with ground, so I was a bit confused at that. Thanks for the help, this is exactly what I was looking for.


All times are GMT -5. The time now is 11:32.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi