Thread: pbasic question
View Single Post
  #6   Spotlight this post!  
Unread 13-01-2003, 14:54
Mike375's Avatar
Mike375 Mike375 is offline
Registered User
#0375 (Robotic Plague)
 
Join Date: Sep 2001
Location: New York City
Posts: 46
Mike375 will become famous soon enough
Send a message via AIM to Mike375
Unhappy still no luck

I tried implementing the serouts with no luck, still just does the last thing in the list. Here is the code, if anyone can spot a problem, I'd highly appreciate hearing from you.


'----------- Another Feeble Attempt at Autonomy------------------------'Declare Variables
auto_mode VAR bit
desired_on VAR byte
motor_fwd VAR byte
motor_stop1 VAR byte
motor_left VAR byte
motor_stop2 VAR byte
motor_rev VAR byte
motor_right VAR byte

auto_mode=1

'Check autonomous mode
if auto_mode = 0 then skip_auto:



'Program 1:
if motor_fwd>300 then next_step1:
p1_y=200
p2_y=200
motor_fwd=motor_fwd+1
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y]
next_step1:

'Program 2:
if motor_stop1>200 then next_step2:
p1_y=127
p2_y=127
motor_stop1=motor_stop1+1
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y]
next_step2:

'Program 3:
if motor_left>300 then next_step3:
p1_y=127
p2_y=200
motor_left=motor_left+1
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y]
next_step3:

skip_auto: