Shop OBEX P1 Docs P2 Docs Learn Events
Problem with the Parallax 5-position switch #27801 — Parallax Forums

Problem with the Parallax 5-position switch #27801

kilometerskilometers Posts: 3
edited 2012-03-31 14:39 in Accessories
This supposed to be a normally open switch but when I test it, all contacts are closed and when I press one of the positions, that contact opens. Am I missing something?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-30 15:17
    How are you testing it?
  • kilometerskilometers Posts: 3
    edited 2012-03-30 16:10
    Mike Green wrote: »
    How are you testing it?

    5 volts to VCC, Pin outputs to LEDs. All LEDs are lit until I set the switch to one of the 5 positions which turns the appropriate LED off.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-30 18:26
    I'm sorry. Your description of the test setup doesn't make sense. What's Vcc in your setup? What pin outputs? How are the LEDs connected?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-03-30 21:41
    The contacts in the 5-position switch are all pulled high. That means when a switch is open it reads 1. When the switch is closed, it reads 0. This is called active LOW, and there are advantages to the approach.

    The documentation mentions this (though indirectly), but it's pointed out in the KickStart examples:

    https://sites.google.com/site/parallaxinretailstores/home/parallax-5-position-switch

    If you wire the LEDs from switch outputs to ground, then yes, they'll be lit when the switch is open because the switch outputs are all internally pulled high with 10K resistors. The LED will turn off when you close the switch, because then the output will go low.

    -- Gordon
  • kilometerskilometers Posts: 3
    edited 2012-03-31 12:29
    Thanks ...all I saw was "open" and didn't understand the role that the resistors played.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-03-31 14:39
    The KickStarts serve to flesh out the documentation while keeping things down home and simple, so it's always good to check to see if there's a KickStart for any sensor or accessory you're using. More will be added in the coming weeks, and they'll eventually be moved to the learn.parallax.com site. Both are worthy of bookmarking!

    -- Gordon
Sign In or Register to comment.