View Single Post
  #6   Spotlight this post!  
Unread 18-02-2003, 00:50
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
Quote:
Originally posted by Mike375
Does a debug statement showing the states of the switches show what you expect.

-I have no idea how debug works


put this in your program and download it:

DEBUG cls,bin8 rc_swA,cr

a little window will appear with a 1's and 0's representation of the first 8 digital inputs.

What code are you using to try to switch programs?

-I was hoping a simple IF THEN in the autonomous section of code would perform this task

example:
counter var word
counter=0

IF auton mode = 1 THEN
select counter


is this all your IF is to decide ? I see no 'endif', efendi.

IF rc_sw1=1 THEN start_left:
IF rc_sw2=1 THEN start_right:


With no distinction, these should execute all the time

'Starting on left side of field
start_left:
(left auto program here)
goto imdone:

'Starting on right side of field
start_right:
(right auto program here)
goto imdone:

ELSE 'Resume Human Control
imdone:
I would make the converse statement,

if auton_mode = 0 then goto end_o_this_code

{auto mode stuff, like if left_sw then goto the_left, &c}

end_o_this_code:

rest of program: