View Single Post
  #2   Spotlight this post!  
Unread 11-01-2003, 14:47
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
That is correct, the BUTTON command is not valid as it relies on having a switch hooked up to one of the pins on the Stamp, which they aren't. What you need is a simple if statement.

2.0:
...
if p4_sw_aux1=0 then dontKill
gosub killLoop
dontKill:
...
serout
goto mainloop

killLoop:
if p4_sw_aux1=1 then keepKilling
return
keepKilling:
Serin...
Serout...
goto killLoop:


2.5:
...
if p4_sw_aux1=1 then gosub killLoop
...
serout
loop

killLoop:
do
serin...
serout...
while p4_sw_aux1=1
return
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php