Shop OBEX P1 Docs P2 Docs Learn Events
Button Craziness — Parallax Forums

Button Craziness

mikeweezermikeweezer Posts: 27
edited 2005-04-24 19:21 in BASIC Stamp
Hello everyone,

So I have decided to make another BS2 Project. I went to the toy store and bought a toy to get all of the touch sensors out of them. I looked at them, and they are a VERY basic button. Much like a keyboard button, they are just two metallic plates, you press the button, they connect. Simple enough, right? So I hook into the stamp. One end goes in P1, the other goes to a 10k resistor that then goes to VDD... From here it has gone haywire... When I debug P1, it is going back and forth between 1 and 0's... It seems to be effected whenever I get within 2 feet of it. If i back away, it seems to calm down...

Am I crazy, or should this work? Please Help!

Thanks
mike

Comments

  • KenMKenM Posts: 657
    edited 2005-04-22 05:22
    If I correctly understand your layout, pin 1 is floating, and a floating pin will do exactly what you have described.

    Without the button pressed there is nothing pulling P1 to a logic 1 or a logic 0.

    Connect the 10k resistor from P1 to +5 volts.

    Connect also to P1 one of the metalic plates.

    Connect the other metalic plate to ground.

    When the button is not pressed debug should yeild a 1.

    Button pressed debug should yield a 0.

    So your program should look for a logic 0 to indicate the button is pressed.


    Post Edited (KenM) : 4/22/2005 5:31:38 AM GMT
    499 x 456 - 26K
    452 x 487 - 26K
  • mikeweezermikeweezer Posts: 27
    edited 2005-04-24 19:21
    Thank You so much for your help!

    Works great.


    - mike
Sign In or Register to comment.