If you already have a 2 volt supply capable of 20ma try this
About 470ohms. Adjust so green and red are equal brightness
/------\/\/\/------ +5v or Ov
---+ LEDs /
| +-->|---+ /
|pin | |/ 47ohms
+-----+ +-----\/\/\------- +2 volt supply
| | |
| +--|<---+
---+
To program:
None= prog pin as input or tristate with no pullup resistor.
One color(Eg. Red) =Prog pin as output and high
Other color (Eg. Green) =Prog pin as output and low
--- In AVR-Chat@yahoogroups.com, Russell Shaw <rjshaw@...> wrote:
>
> Peter Gargano wrote:
> > I can't figure this out simply. I'm sure there is a simple solution
> > tho'. Chip is the Mega-168 that I want to add an extra function to.
> >
> > Assume I have either a two or three pin bi-colour LED (ie. either
back
> > to back LEDs with two pins, or two LEDs with a common pin).
> >
> > I have a single pin on an AVR processor that can either be LOW, HIGH,
> > or Tri-state.
> >
> > I want to drive the LEDs either both OFF, one on, or the other on,
but
> > NOT both on.
> >
> > SO, I have three states the pin can be in, and three states for the
> > LED to be in.
> >
> > I can't figure out a simple circuit to drive the LEDs with just one
> > processor pin. Does anyone have any ideas how to do it using no more
> > than two transistors? I'm using Vcc=5 Volts and I have a free 2 Volt
> > (low current) reference point I can use.
> >
> > I'd be most appreciative of a solution. BTW, the solution cannot use
> > PWM or anything processor intensive. The spare pin is either and ADC
> > input or an I/O pin.
> >
> > Alternative solution: can anyone suggest how I can use the RESET pin
> > as an output and still retain ISP capability (this is a QFP part that
> > is programmed after assembly).
> +5VCC
> --+----------+--
> | |
> AVR |c NPN >
> ---+ LEDs \|b__ < 10k
> | +-->|---+ /| | >
> |pin | | 220ohms |e | |
> +-----+ +-----\/\/\-------+ +----+
> | | | |e | |
> | +--|<---+ \|b__| >
> ---+ /| < 10k
> |c PNP >
> | |
> ----+----------+---- GND
>Message
Re: Bi-Colour LED coontrol with one pin?
2006-03-05 by Ted Smith
Attachments
- No local attachments were found for this message.