|
Autonomous Program Code
Here's the autonomous code that we are using. It seems to work. You are welcome to use it as you see fit.
I turn the Robot Controller's Basic Run LED off when the Competition Control is disabled, turn it on during the Autonomous Robot Control period, and make it flash during the Operator Control period. This gives me an indication on the Robot Controller similar to the Competition Control indicator on the Operator Interface.
If comp_mode = 0 then Relay_Control
'Competition Control is disabled
Out7 = 0 'Basic Run LED off when Competition Control disabled
Goto End_Control
Relay_Control:
'Competition Control is enabled
relay3_fwd = rc_sw3 'Air compressor on when pressure switch closed - Green
relay3_rev = 0 'Disable Relay 3 reverse function
relay8_fwd = 1 'Rotating light on when Competition Control not disabled - Green
relay8_rev = 0 'Disable Relay 8 reverse function
If auton_mode = 0 then Oper_Control
'Game is in Autonomous Robot Control Period
Out7 = 1 'Basic Run LED on during Autonomous Robot Control Period
'ADD OTHER AUTONOMOUS PROGRAM CODE HERE
Goto End_Control
Oper_Control:
'Game is in Operator Control Period
Toggle 7 'Basic Run LED flashes during Operator Control Period
relay1_fwd = p1_sw_trig 'Left Index - Lower Left Arm - Green
relay1_rev = p1_sw_top 'Left Thumb - Raise Left Arm - Red
relay2_fwd = p2_sw_trig 'Right Index - Lower Right Arm - Green
relay2_rev = p2_sw_top 'Right Thumb - Raise Right Arm - Red
End_Control:
Hope this helps...
__________________
There are 10 kinds of people in this world; those who understand binary and those who don't.
|