can i use 2 wire 2 colored leds with 1 pin of a bs2p
the led lights red or green depending on polarity
so say when pin is high the led is green
when pin is low led is red walt@f...
--- In basicstamps@y..., "walt" <walt12414@y...> wrote:
> can i use 2 wire 2 colored leds with 1 pin of a bs2p
> the led lights red or green depending on polarity
> so say when pin is high the led is green
> when pin is low led is red
> walt@f...
sure. just route the pin thru an appropriate resistor, say 470 ohm,
then the green led. also route the pin thru an inverter, an
appropriate resistor, then the red led. the inverter can be a nand
gate or nor gate with the inputs all wired together. don't use an
open collector inverter. the center lead of the led's goes to ground.
>--- In basicstamps@y..., "walt" <walt12414@y...> wrote:
> > can i use 2 wire 2 colored leds with 1 pin of a bs2p
> > the led lights red or green depending on polarity
> > so say when pin is high the led is green
> > when pin is low led is red
> > walt@f...
>
>sure. just route the pin thru an appropriate resistor, say 470 ohm,
>then the green led. also route the pin thru an inverter, an
>appropriate resistor, then the red led. the inverter can be a nand
>gate or nor gate with the inputs all wired together. don't use an
>open collector inverter. the center lead of the led's goes to ground.
>
And of course you can get RED/GREEN/NEITHER if you want to
waste some current. Just put two of the 470 ohm resistors
in series across the 5v supply. Tie one side of the bicolor LED
to the junction of the two resistors and the other side to
the STAMP pin. HIGH gives you one color, LO gives you the other,
and switching the pin to input turns them both off.
>--- In basicstamps@y..., "walt" <walt12414@y...> wrote:
>> can i use 2 wire 2 colored leds with 1 pin of a bs2p
>> the led lights red or green depending on polarity
>> so say when pin is high the led is green
>> when pin is low led is red
>> walt@f...
>
>sure. just route the pin thru an appropriate resistor, say 470 ohm,
>then the green led. also route the pin thru an inverter, an
>appropriate resistor, then the red led. the inverter can be a nand
>gate or nor gate with the inputs all wired together. don't use an
>open collector inverter. the center lead of the led's goes to ground.
Hi Walt,
Another way uses a supply splitter like the TLE2426 (Texas
Instruments--the chip provides a "virtual ground" at 1/2 the supply
voltage--very useful TO92)
high 0 ' led red
low 0 ' led green
input 0 ' led off
If you are going to leave the led off (input 0) for long periods, add
a 1 meg pullup from P0 to Vdd, in order to keep the input well above
the Stamp switching threshold.
Comments
> can i use 2 wire 2 colored leds with 1 pin of a bs2p
> the led lights red or green depending on polarity
> so say when pin is high the led is green
> when pin is low led is red
> walt@f...
sure. just route the pin thru an appropriate resistor, say 470 ohm,
then the green led. also route the pin thru an inverter, an
appropriate resistor, then the red led. the inverter can be a nand
gate or nor gate with the inputs all wired together. don't use an
open collector inverter. the center lead of the led's goes to ground.
> > can i use 2 wire 2 colored leds with 1 pin of a bs2p
> > the led lights red or green depending on polarity
> > so say when pin is high the led is green
> > when pin is low led is red
> > walt@f...
>
>sure. just route the pin thru an appropriate resistor, say 470 ohm,
>then the green led. also route the pin thru an inverter, an
>appropriate resistor, then the red led. the inverter can be a nand
>gate or nor gate with the inputs all wired together. don't use an
>open collector inverter. the center lead of the led's goes to ground.
>
And of course you can get RED/GREEN/NEITHER if you want to
waste some current. Just put two of the 470 ohm resistors
in series across the 5v supply. Tie one side of the bicolor LED
to the junction of the two resistors and the other side to
the STAMP pin. HIGH gives you one color, LO gives you the other,
and switching the pin to input turns them both off.
Reg Neale
>> can i use 2 wire 2 colored leds with 1 pin of a bs2p
>> the led lights red or green depending on polarity
>> so say when pin is high the led is green
>> when pin is low led is red
>> walt@f...
>
>sure. just route the pin thru an appropriate resistor, say 470 ohm,
>then the green led. also route the pin thru an inverter, an
>appropriate resistor, then the red led. the inverter can be a nand
>gate or nor gate with the inputs all wired together. don't use an
>open collector inverter. the center lead of the led's goes to ground.
Hi Walt,
Another way uses a supply splitter like the TLE2426 (Texas
Instruments--the chip provides a "virtual ground" at 1/2 the supply
voltage--very useful TO92)
2-lead TLE2426
bicolor ;--;
;--|<--; 2.5| |--- Vdd
P0 ----o->|---o--/\/\
| |
150 ohm |__|--- Vss
high 0 ' led red
low 0 ' led green
input 0 ' led off
If you are going to leave the led off (input 0) for long periods, add
a 1 meg pullup from P0 to Vdd, in order to keep the input well above
the Stamp switching threshold.
-- best regards
Tracy Allen
electronically monitored ecosystems
http://www.emesystems.com
mailto:tracy@e...