Shop OBEX P1 Docs P2 Docs Learn Events
reading dipswitches (revisited) — Parallax Forums

reading dipswitches (revisited)

ArchiverArchiver Posts: 46,084
edited 2003-03-07 03:01 in General Discussion
Thank you all for the reponses to my previous post, but I just
realized I might be hooking it up wrong from the start....
I have one side of each dipswitch hooked to its own i/o pin (set to
input) and the other side set to ground. Won't that do...nothing at
all? It seems to me that I have it hooked up in a way that there
isn't any current to flow into those input pins, to be detected.
Should I instead have one end of each switch connected to an INPUT pin
and the other and connected to an OUTPUT pin?

And if so, can I connect all four to the SAME output pin?

thanks again,
--Alex

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-03-07 03:01
    Alex,

    You'll need some pullup resistors on your input pins to make the input
    high when the dip switch isn't closed to ground. 10k should do.

    HTH.
    Mos.

    --
    84 AE86, 90 ST185GrpA, 91 MX83Gr, Sydney, Oz.

    On Fri, 7 Mar 2003, atl_guy1138 wrote:

    > Thank you all for the reponses to my previous post, but I just
    > realized I might be hooking it up wrong from the start....
    > I have one side of each dipswitch hooked to its own i/o pin (set to
    > input) and the other side set to ground. Won't that do...nothing at
    > all? It seems to me that I have it hooked up in a way that there
    > isn't any current to flow into those input pins, to be detected.
    > Should I instead have one end of each switch connected to an INPUT pin
    > and the other and connected to an OUTPUT pin?
    >
    > And if so, can I connect all four to the SAME output pin?
    >
    > thanks again,
    > --Alex
Sign In or Register to comment.