[dorkbotpdx-blabber] Just a question re: Dorkboard
Paul Stoffregen
paul at pjrc.com
Mon Jan 26 12:47:37 EST 2009
> Why does 13 being set "high" turn the LED off, and being set
> low turn it on?
>
Probably because that's the way you wired it to the board, which is the
"normal" way.
If you connect the LED and resistor between the I/O pin and +5 volts,
then one side of the LED is already at 5 volts. When you drive the pin
high, that makes both sides of the LED at +5 volts, so as far as the LED
is concerned it has no power applied. When you drive the pin low, there
is power applied to the LED because the other side is permanently
connected to +5 volts.
This is the "normal" way because many types of I/O pins are able to
drive a lot more current in their low condition than their high state.
There are technical reasons for this involving the design of the
transistor sizes inside the chip. However, the AVR chips have
approximately equal capability when high or low, so you can connect the
LED the other way if you really want high to be "on" and low to be "off".
-Paul
More information about the dorkbotpdx-blabber
mailing list