|
Example of Autonomous Code
Here is an example of some autonomous code that works. You are welcome to use it as you see fit. Hope this helps.
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 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:
__________________
There are 10 kinds of people in this world; those who understand binary and those who don't.
|