Shop OBEX P1 Docs P2 Docs Learn Events
Help a newb pt 2?- — Parallax Forums

Help a newb pt 2?-

ExilictExilict Posts: 31
edited 2004-09-25 00:24 in BASIC Stamp
This is my 2nd newbie question :-(

I have searched and searched but I cant find a command that will pause the program untill there is a input on one pin.· I am simulating a trigger pull, and I dont want anything to happen untill that switch is pulled.

Help would be great :-D

Thanks
·· Chris

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-25 00:22
    You can do it in a loop. Let's say, for example, that you want to wait for P0 to go high (1) before moving on:

    Hold_Here:
    · IF (IN0 = 0) THEN Hold_Here

    Another way to do it, without a label, is....

    · DO : LOOP UNTIL (IN0 = 1)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • ExilictExilict Posts: 31
    edited 2004-09-25 00:24
    Duh! That only made too much sence! Thank you for your help!

    -Chris
Sign In or Register to comment.