Shop OBEX P1 Docs P2 Docs Learn Events
Coding Question — Parallax Forums

Coding Question

wonkawonka Posts: 12
edited 2005-04-13 05:06 in BASIC Stamp
Hello, I am having a problem with coding. I am trying to use a switch as a input but I but I want it to go back to the·main of the code. The tricky part is I can not get it to turn off, or go to the main·of the code if i change my switch state. It finish my loop then turns off. I just want it to turn off or go back to the main untill it on again.

Thanks alot
Adam

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-13 05:05
    Post you code -- it will be easier for others to help with specific information.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-13 05:06
    wonka,

    ·· On the input the switch is either tying the line high or low...But what's pulling the pin the other direction?· In other words, if your switch is active low, you should have a 10K pull-up resistor tied from the pin to Vdd (+5V).· If the switch is active high, you should have a 10K pull-down resistor going from the pin to Vss (Ground).· Without this the pin will float.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.