Thread: pbasic question
View Single Post
  #7   Spotlight this post!  
Unread 13-01-2003, 15:34
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
First, because you are using byte-sized variables, you're never going to have values greater than 300. It seems odd, but 255+1=0.

Second, I don't see any gotos. If I understand your code correctly, you are trying to create three separate loops, no? If so, add a quick goto after each serout that sends the code back to the beginning of that section (ie "goto Program1:", etc).

Third, you're going to need to initialize your counters. Just set them all to zero immediately after declaring them. Otherwise, operations like "motor_fwd=motor_fwd+1" have no meaning since there is not motor_fwd to increment the first time through the loop.

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