Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sourcing/Sinking LED current

Status
Not open for further replies.
Something I never really thought about or had to do is Sink LED current.

To light an LED I always connect the (+)anode to the output pin of the µC, and the (-)cathode to ground.
And configure the output pin i am using for the LED as an 'Ouput' and i 'set' the ouput to light the LED, and 'clear' the output to trun it off.

But if i connect the LED the other way...
postive suuply to the (+)anode, and the (-)cathode to the µC (with resistor of course)
I now want to sink current, instead of sourcing it like above.

Im gussing the PORT pin that the LED is connected to should be configured to an INPUT (seen as though i want to sin currect),
So My question is...
what state should the input pin be for the LED to be on, and off.

How do you make the input pin go into 'high impedance' (to trun the LED off) and then, how do you make the input sink current so the LED lights.

The reason for this is using a Common Anode LED 7 segment.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top