Toggle
Archiver
Posts: 46,084
I have a very simple system with 2 LEDs. One connected to pin 0, one
connected to pin 1. I then use TOGGLE to turn them on or off.
Sometimes I need to determine whether or not a pin is turned on, so I
use OUT0 or OUT1. I found however, that if OUT0 is 1, the first LED
is off, while if OUT1 is 1, the second LED is turned ON. I am a bit
confused about this. I can work around that, but why is there no
consistency?
connected to pin 1. I then use TOGGLE to turn them on or off.
Sometimes I need to determine whether or not a pin is turned on, so I
use OUT0 or OUT1. I found however, that if OUT0 is 1, the first LED
is off, while if OUT1 is 1, the second LED is turned ON. I am a bit
confused about this. I can work around that, but why is there no
consistency?
Comments
installed backwards from each other.
If both LED's are installed the same
way, both tied to +5, and both have
identical current-limiting resistors
on them, then OUT1 = 0 should turn one on,
and OUT0 = 0 should turn the other on.
--- In basicstamps@yahoogroups.com, "sartbab" <sartbab@y...> wrote:
> I have a very simple system with 2 LEDs. One connected to pin 0,
one
> connected to pin 1. I then use TOGGLE to turn them on or off.
> Sometimes I need to determine whether or not a pin is turned on, so
I
> use OUT0 or OUT1. I found however, that if OUT0 is 1, the first LED
> is off, while if OUT1 is 1, the second LED is turned ON. I am a bit
> confused about this. I can work around that, but why is there no
> consistency?