Loading...
Pages: [1]   Go Down
Author Topic: 2 leds one comparator output  (Read 203 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to know if it is possible to control two leds separately using a single comparator output. ie above a certain voltage a  green led is on and a red is off, below a certain voltage, the green led is off and the red is on.

Thank you in advance
Logged

Offline Offline
Edison Member
*
Karma: 21
Posts: 1354
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, if the comparator has an open collector output 1.

> > >  1 Like an LM339, for example.
« Last Edit: January 27, 2013, 11:22:40 am by Runaway Pancake » Logged

Don't Be Upset By The Results You Didn't Get With The Work You Didn't Do

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 8
Posts: 387
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am totally unfamiliar with a comparator, but i am familir with charlieplexing, you could charlieplex 2 LEDs, and reverse polarity to switch LEDs.
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 25394
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to know if it is possible to control two leds separately using a single comparator output. ie above a certain voltage a  green led is on and a red is off, below a certain voltage, the green led is off and the red is on.
Where is this variable voltage coming from?
If it is the analogWrite command be aware that this does not output a variable voltage but a pulse width modulated signal. You need a filter to make that an analogue voltage.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
Logged

Pages: [1]   Go Up
Print
 
Jump to: