Shop OBEX P1 Docs P2 Docs Learn Events
Novice question — Parallax Forums

Novice question

TresgueyTresguey Posts: 1
edited 2006-04-17 02:55 in BASIC Stamp
I am trying a night rider program i got from Evil Genius. but i am getting some sort of feedback to pin 9 after low hits pin 3 coming back. and blinks pin 9 at the same rate i have the pause at. why is this?
' {$STAMP BS2}
' {$PBASIC 2.5}
' variables
direction VAR Byte
lsb PIN 0
msb PIN 9
OUTS = %1111111110
DIRS = %1111111111
direction = 0
DO
IF (direction = 0)THEN
OUTS = OUTS << 1 + 1
IF (msb = 0) THEN
direction = 1
ENDIF
ELSE
OUTS = OUTS >> 1
msb = 1
IF (lsb = 0) THEN
direction = 0
ENDIF
ENDIF
PAUSE 10
LOOP
RETURN
Sign In or Register to comment.