Shop OBEX P1 Docs P2 Docs Learn Events
Building a counter — Parallax Forums

Building a counter

skyshiroskyshiro Posts: 2
edited 2010-02-20 17:38 in BASIC Stamp
warning:
x+1
IF x=3 THEN lock
FOR a=1 TO 3
  LOW 8
  PAUSE 200
  HIGH 8
  PAUSE 200
NEXT
GOTO STEP_1



I'm trying to build a routine where if you press the wrong button in the sequence 3 times it goes into the lock routine,
but if you press the wrong button it just flashes a LED and goes back to Step 1. Any tips?

Comments

  • legoman132legoman132 Posts: 87
    edited 2010-02-20 01:28
    Looks like it would work, Just change "lock" to "GOSUB lock" or "GOTO lock"

    Post Edited (legoman132) : 2/20/2010 1:13:29 PM GMT
  • skyshiroskyshiro Posts: 2
    edited 2010-02-20 17:38
    I got it to work, changed the x+1 to x=x+1 and that fixed it.
Sign In or Register to comment.