Difference between revisions of "SquareDance.BS2"
From RoboWiki
(New page: <source lang="basic"> </source>) |
|||
Line 1: | Line 1: | ||
<source lang="basic"> | <source lang="basic"> | ||
+ | ' {$STAMP BS2} | ||
+ | ' {$PBASIC 2.5} | ||
+ | |||
+ | Counter VAR Byte | ||
+ | |||
+ | DEBUG "Program Running!" | ||
+ | |||
+ | Main: | ||
+ | |||
+ | GOSUB Forward | ||
+ | GOSUB Right | ||
+ | GOTO Main | ||
+ | |||
+ | END | ||
+ | |||
+ | Forward: | ||
+ | FOR counter = 1 TO 50 | ||
+ | PULSOUT 13, 850 | ||
+ | PULSOUT 12, 650 | ||
+ | PAUSE 20 | ||
+ | NEXT | ||
+ | PAUSE 200 | ||
+ | RETURN | ||
+ | |||
+ | |||
+ | Right: | ||
+ | FOR counter = 1 TO 22 | ||
+ | PULSOUT 13, 850 | ||
+ | PULSOUT 12, 850 | ||
+ | PAUSE 20 | ||
+ | NEXT | ||
+ | PAUSE 200 | ||
+ | RETURN | ||
+ | |||
</source> | </source> |
Latest revision as of 12:46, 15 February 2011
' {$STAMP BS2}
' {$PBASIC 2.5}
Counter VAR Byte
DEBUG "Program Running!"
Main:
GOSUB Forward
GOSUB Right
GOTO Main
END
Forward:
FOR counter = 1 TO 50
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
PAUSE 200
RETURN
Right:
FOR counter = 1 TO 22
PULSOUT 13, 850
PULSOUT 12, 850
PAUSE 20
NEXT
PAUSE 200
RETURN