View Single Post
  #1   Spotlight this post!  
Unread 04-02-2011, 21:28
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi

Well, I've been busy tonight. See, I purchased some nice LED strips from SuperBrightLEDs.com (If you're an LED nerd, you probably should go look at it if you haven't already. I've had 3 or 4 orders from them and have been overly pleased by their service.)

Anyway, enough promoting them.

I purchased two of the RLBN-RGB30SMD RGB Narrow Rigid Light Bar that can be found on this page along with some other LED goodies. (Hmm... what else could we be doing with LEDs?).

Well, over the past two days at robotics, I've been making a PWM based control box to control each individual color channel, 6 in all (3/strip x 2 strips = 6). I finished building the control box just a few minutes before that session was over, so I never really got to go in deep with any programming with our programmer. We did verify that my box was working well with some simple on and off switches in LabVIEW.

Here are the VIs that just came in hot off of my mouse.

Underglow_Begin.vi (placed in the Begin.vi)
Click image for larger version

Name:	Underglow Begin.PNG
Views:	67
Size:	29.3 KB
ID:	9966

Underglow_Control.vi (placed in the 100ms loop in Periodic Tasks.vi)
Click image for larger version

Name:	Underglow Control.PNG
Views:	38
Size:	41.2 KB
ID:	9967

Underglow_Close.vi (placed in Finish.vi)
Click image for larger version

Name:	Underglow Close.PNG
Views:	22
Size:	20.4 KB
ID:	9968

If anyone wants the source code, here it is.
Underglow LED VIs.zip

Anyway, so what's the point of this thread? Well I have a question regarding the WPI_DigitalOutputGeneratePWM.vi
Click image for larger version

Name:	WPI_DigitalOutputGeneratePWM.PNG
Views:	20
Size:	15.8 KB
ID:	9970

It says that this VI will allocate 1 of 4 PWM generators. I'm guessing that means I can only have 4 of these in my Underglow_Control.vi? Maybe someone here who has used this control before can spread a little light on it?

Now I would use that handy WPI_PWMSetValue.vi, except that we only have 4 PWM channels free, plus the spacing and such between the PWM headers would make it more of a wiring hassle rather than just using the signal pins that I already have and using 1 PWM cable for each LED strip. Plus... we're using up 6 of the 10 PWM outputs, and we would rather not add an additional sidecar.

My only other idea is to combine both LED strips into 1 using a Y-cable and using 3 of the WPI_PWMSetValue.vi's unless I can truly use 6 of them (which I hope).

Let me know your thoughts, or if you have any questions about my project, just ask.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364

Last edited by RyanN : 04-02-2011 at 21:54.