Forum Index
Lighting LEDs

 
Author Message
abcuser



Joined: 27 Mar 2008

Posted: 05 July 2008, 19:00 PM    Post subject: Lighting LEDs

I like to know is there any way to output a voltage of 2.5volts on Pins 5,6 and 7 to light up 3 LED's on the zx24a.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 05 July 2008, 21:01 PM    Post subject: Re: Lighting LEDs

abcuser wrote:
I like to know is there any way to output a voltage of 2.5volts on Pins 5,6 and 7 to light up 3 LED's on the zx24a.
Being a digital device, there is no way to output a particular voltage other than logic 1 and logic zero.

That said, it is relatively easy to drive LEDs. Unless you have some special type of LED, you illuminate an LED by driving it with a certain current - the higher the current, the brighter the output (being careful not to exceed the maximum allowable current). I find it convenient to drive LEDs by connecting the anode to a current limiting resistor, the other side of which is connected to a +5V, and then connecting the cathode to an I/O pin. To illuminate the LED, the the I/O pin to logic 0 and current will flow. Setting the I/O pin high will turn off the LED.

You calculate the size of the current limiting resistor by the equation below.
Code:
Rlimit = (Vcc - Vf) / Iled
where Iled is the current that you want to flow through the LED and Vf is the "foward voltage" drop across the LED at that current. These values are obtained from the datasheet for the LED.

If you can provide a link to the datasheet for the LED in question we may be able to provide more specific information. Also, it would be helpful if you would explain why you believe that you need 2.5 volts.
Back to top
abcuser



Joined: 27 Mar 2008

Posted: 06 July 2008, 0:25 AM    Post subject:

It worked, thanks. I did it using resistors
Back to top
Display posts from previous:   
Page 1 of 1

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group