|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#10
|
|||||
|
|||||
|
Here...Lemme put into comments what need to be fixed:
'******************** counter var word counter=0 IF auton mode = 1 THEN 'needs to be auton_mode select counter IF rc_sw1=1 THEN start_left: 'lose the colon... IF rc_sw2=1 THEN start_right: 'lose the colon '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: '************************** Here is what it should look like corrected (with a few tweaks added for efficency): '************************** counter var word counter=0 IF auton_mode = 1 THEN goto auton_on else goto imdone endif auton_on: select counter IF rc_sw1=1 THEN start_left IF rc_sw2=1 THEN start_right '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 'Resume Human Control imdone: '********************** You could also just use 1 switch for the left-right selection. Have it if the switch is open, then it goes left, else it goes right. This way, you avoid the instance of having both acidetally closed or open. Here is what your code would look like: '********************** counter var word counter=0 IF auton_mode = 1 THEN goto auton_on else goto imdone endif auton_on: select counter IF rc_sw1=1 THEN goto start_left else goto start_right endif '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 'Resume Human Control imdone: '********************* Hope this helps. Bill B. Last edited by Scooter : 18-02-2003 at 20:54. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2-week FIRST summer program @ WPI | ColleenShaver | General Forum | 20 | 31-05-2009 03:02 |
| Fried program slots? | Jeff Waegelin | Programming | 18 | 19-03-2003 18:08 |
| Ahh! Program trick confusing! | archiver | 2001 | 9 | 24-06-2002 02:26 |
| Credits for FIRST program. | archiver | 2000 | 6 | 24-06-2002 00:16 |
| An invitation for HS Juniors | archiver | 2000 | 0 | 23-06-2002 22:51 |