Shop OBEX P1 Docs P2 Docs Learn Events
waitkey function for bs2? — Parallax Forums

waitkey function for bs2?

dr_eggman198dr_eggman198 Posts: 15
edited 2005-07-05 23:59 in BASIC Stamp
I was wondering if there is some type of pbasic command that woulld be similar to a waitkey function, where the basic stamp wpuld have to wait until a signal was sent to a pin in order to proceed with the next line of code.

Comments

  • Philip GamblinPhilip Gamblin Posts: 202
    edited 2005-07-05 23:43
    look at PULSIN and/or DEBUGIN in the help files.
  • NewzedNewzed Posts: 2,503
    edited 2005-07-05 23:44
    Take a look at the "ON" instruction in the Editor Help file - will that do what you want?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • dr_eggman198dr_eggman198 Posts: 15
    edited 2005-07-05 23:54
    i'm making a tic tac toe circuit, and the stamp outputs at a certain pin that corresponds to a led based on what the human has input. for example, if pin 7 and pin 9 are on, and the human inputs 8, then the stamp will output pin 5. But if the human doesn't input at pin 8, then the stamp will output at a different pin. The problem is that I think the stamp will assume that the human didn't input at pin 8, because of the bs2's speed over the human's,
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-05 23:54
    You could use a DO...LOOP, for example:

    DO : LOOP UNTIL IN0 = 0
    

    This piece of code will sit in that loop until the active LOW (Pulled HIGH) button on P0 is pressed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-05 23:56
    Okay, your new post kind of negates the previous one I posted.· That's a whole different concept.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • dr_eggman198dr_eggman198 Posts: 15
    edited 2005-07-05 23:59
    ok, that seems like it will work. Thanks.
Sign In or Register to comment.