RGB LED Control (Moved)

brotowski

New Member
Hey guys.
I'm a very new user. I chose the picaxe for my first chip after seeing the support you guys gave out on this site. I am trying to do an rgb controller using a phidgets circular touch sensor adapted to an 18x's adc, as well as a force gauge for brightness. Any ideas (in language a beginner could understand) on how to control an rgb led accuratly with this system? Any help at all is greatly appreciated
Thanks again, the new guy.
 

eclectic

Moderator
Hey guys.
I'm a very new user. I chose the picaxe for my first chip after seeing the support you guys gave out on this site. I am trying to do an rgb controller using a phidgets circular touch sensor adapted to an 18x's adc, as well as a force gauge for brightness. Any ideas (in language a beginner could understand) on how to control an rgb led accuratly with this system? Any help at all is greatly appreciated
Thanks again, the new guy.
Brotowski.
I'm sure that you will get a lot of help, but first, some questions:

1. What is a "phidgets circular touch sensor"?
2. What sort of "force gauge"?
3. Can you supply some more detail about your overall project?


I suggest that you build a simpified system first, based on program 1 of post #1.

e.
 
Last edited:

brotowski

New Member
Thanks

thanks eclectic. Here's the backround on my project. I want to use hopefully an 18x to interface an RGB led. The sensors I want to run are; an FSR from this link: http://www.trossenrobotics.com/flexiforce-25lb-resistive-force-sensor.aspx, and hopefully not the touch sensor anymore but just a 100kohm pot wired through a voltage divider into adc2 with the fsr in adc1. Could I control the led with pwm? What about hard wiring each cathode ( it's common anode) to one of the outputs directly? As you can probably see, I have not idea what I am doing
thanks
 

brotowski

New Member
up in the air

As i am still in the planning phase, would a 40X1's hpwm circuits be able to do this? There are four of them so i could control the led with only three of them.
any ideas?

Thanks again.
 

hippy

Technical Support
Staff member
While the 40X1 has HPWM and it's notionally 4 individual PWM's that's not so. It's a single PWM which can be routed to one or more of those pins. Any of those pins doing PWM will give the same output ( or inverted ).
 

eclectic

Moderator
Brotowski

I've just tried wiring 3 x LED's in Common Anode mode.

It works, using this modified program

Code:
'Forum Sa  05 07 08  rgbpulsin
;Common Anode mode
; V+ > res > LED > pin

#picaxe 08M
let dirs = %00010110  ; set 1,2,4 as outputs
let pins = %00010110  ; MAKE 1,2,4 high

symbol rTime = b0
symbol gTime = b1
symbol btime = b2
symbol xtime = w2
symbol R_LED = 1
symbol G_LED = 2
symbol B_LED = 4
symbol dummy = 0

setfreq m8
 main:
 for rTime = 1 to 255  step 5
 for gTime = 0 to 255  step 5
 for bTime = 0 to 255  
  
 xTime = 766 - rTime - gTime - bTime
 PulsOUT R_LED, rTime
 PulsOUT G_LED, gTime
 PulsOUT B_LED, bTime
 PulsOut DUMMY, xTime
 next
 next
 next
The "pulsout" commands make the pin LOW,and the LED's light,
for the required time.
e.

Added. Sensors and resistance.
The recommended ADC resistance (impedance) is 10k. (Many references on the Forum).

A 100k potentiometer and the ~800k of
http://www.trossenrobotics.com/flexiforce-25lb-resistive-force-sensor.aspx

look as though they are far too high for reliable readings.
 
Last edited:

hippy

Technical Support
Staff member
I've moved this discussion out of Finished Projects into its own separate thread.
 

BCJKiwi

Senior Member
PWM can be used on a CC LED - the LED switches on when the PWM wave form is low.

i.e. PWM port sinks current when PWM waveform is low and sources current when PWM waveform is high.

Currently using this technique on a P channel mosfet to switch the gate which has to go low to turn on.
 
Top