Shop OBEX P1 Docs P2 Docs Learn Events
Toggle — Parallax Forums

Toggle

ArchiverArchiver Posts: 46,084
edited 2004-02-06 22:00 in General Discussion
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?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-02-06 22:00
    This typically happens when the LED's are
    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?
Sign In or Register to comment.