![]() |
Auton Mode simple question
All right, from what I understand before the match the inputs will be this:
comp_mode = 1 auton_mode = 0 then when autonomous mode is engaged it will change to: comp_mode = 0 auton_mode = 1 and after the match is over it will be: comp_mode = 1 auton_mode = 0 So if I put code in my robot like this: autonloop: if (comp_mode = 0 AND auton_mode = 1) then 'whatever you want it to do during autonmode goto autonloop: endif then you shouldn't have to worry about timing assuming that you can take your ques off of the comp and auton variable changes. Would this work? |
search for comp_mode, but I'm pretty sure comp_mode is set to 1 whenever the robot is on, so to speak.
|
But would it be legal? (changing that is a quick fix)
|
To tell you the truth, there are not to many rules in software except that it must work and teams are responsible for any problems with it.
Morgoth your code look correct too. |
Thanks, now I don't have to worry about the timing.
|
Actually, Team Update #11 changed these bits
Before match - comp=1,auto=0 During autonomous - comp=0,auto=1 During human driver - comp=0,auto=0 After match is over - comp=1,auto=0 Note that 'comp' and 'auto' are abbreviations for actual variable names. So what you originally said was correct. Sorry about that. |
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... |
Quote:
If the auton_mode is 1 at some time during the match, and comp_mode is turned on (can you say DQ?), auton_mode cannot remain 1. When the comp_mode is switched to 0 again, auton_mode goes to 1. (I used a New Yellow Dongle.) |
| All times are GMT -5. The time now is 14:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi