Thread: pbasic question
View Single Post
  #4   Spotlight this post!  
Unread 11-01-2003, 14:37
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
2.5 will make it much easier, but you can do it in 2.0 if you want. Here would be the 2.5 code:

Code:
counter VAR word
counter=0

mainloop:
serin...

if auton_mode then
  counter=counter+1
  SELECT counter
    CASE 0 to 100
       'go forward
    CASE 101 to 200
       'pause
    CASE 201 to 300 
       'turn
    CASE else
       'pause
    ENDSELECT
ELSE
   'regular robot code
ENDIF

serout
goto mainloop
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php