cancel
Showing results for 
Search instead for 
Did you mean: 

How to drive bicolor LEDs by one pin.

ETsog.1
Associate II

How to drive bicolor LEDs by one pin. I think turn off LEDs when setting GPIO input. But it is not. On pin high level. What is problem.0693W00000Ba7QlQAJ.png

11 REPLIES 11
Javier1
Principal

When you set GPIO as input youre effectively removing the conexion, what remains is both leds with their resistors perfectly polariced to start driving current.

If this design is already in place you could try to increase R1 and R2 untill they are big enough to avoid D1 and D2 to simultaneously drive current when you set GPIO input.

I expect this to be happening in this setup:

  • GPIO is high impedance(input): D1 on(less bright) D2 on(less bright)
  • GPIO 3v3 : D1 off D2 on (d2 full brightness)
  • GPIO GND:D1 on D2 off (d1 full brightness)

Try this instead:http://dangerousprototypes.com/blog/2011/10/24/driving-a-bicolor-led-from-a-single-output-pin/

we dont need to firmware by ourselves, lets talk

i want to turn LEDs off. Then to make the GPIO input, it has to be HI-Z. But not D2 is light on.

I didnt understand you.

You mean when GPIO is input only D2 is on?

we dont need to firmware by ourselves, lets talk

Same not complete working!!! only one is working.

For example One led over CR filter to gnd, second over RC to gnd. Then GPIO L no led , GPIO H Led 2 light and calculated PWM only 1 or both...

I did not understand anything , sorry.

You could try it in your native languaje and translate it with google?

we dont need to firmware by ourselves, lets talk
Hmm CR is high pass filter normal slang , for exampel C=100nF R= 500R and LED1 in the series ...
then RC is low pass filter here C and LED2 in parallel usw... (PWM is pulse width modulation)

0693W00000BaISJQA3.pngNot working both with R1, R2 = 10K, and R1,R2 = 1K. When remove R1, GREEN is working and remove R2, RED is working.

MM..1:

Good idea thank you.