View unanswered posts | View active topics It is currently Sat Aug 23, 2014 3:17 pm






Reply to topic  [ 3 posts ] 
Two Quick Competition Related Questions 
Author Message
Rookie

Joined: Tue Jul 26, 2011 8:19 pm
Posts: 15
Post Two Quick Competition Related Questions
  • Is the "pre_auton()" function called more than once prior to Autonomous?
  • If not, what's the best way to check when the "pre_auton()" period has ended so that I can break myself out of a loop that is being used to select an Autonomous?

Any help would be really appreciated.

_________________
Member of the Sarah Heinz House VEX and FIRST teams.


Wed Jan 23, 2013 12:48 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 565
Post Re: Two Quick Competition Related Questions
By default, the pre_auton function is called at the beginning of task main() only. It is possible to enter the pre_auton function multiple times in a match, however; if either the robot resets itself or if the user manually calls the pre_auton function, the robot will go through the function two (or more) times.

When you say you are breaking yourself out of a loop, what exactly do you mean by that? Would you be able to post your code in question for us to look at? From what I'm seeing, you may be looping in pre_auton and gathering sensor data, then using that data to determine which autonomous function to call? If this is the case, there may be better, more secure ways to do this (please correct me if I am wrong in assuming this though).

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Thu Jan 24, 2013 11:12 am
Profile
Rookie

Joined: Tue Jul 26, 2011 8:19 pm
Posts: 15
Post Re: Two Quick Competition Related Questions
JohnWatson wrote:
By default, the pre_auton function is called at the beginning of task main() only. It is possible to enter the pre_auton function multiple times in a match, however; if either the robot resets itself or if the user manually calls the pre_auton function, the robot will go through the function two (or more) times.

When you say you are breaking yourself out of a loop, what exactly do you mean by that? Would you be able to post your code in question for us to look at? From what I'm seeing, you may be looping in pre_auton and gathering sensor data, then using that data to determine which autonomous function to call? If this is the case, there may be better, more secure ways to do this (please correct me if I am wrong in assuming this though).


I am trying to use either a Sensor or the LCDs physical buttons to select an Autonomous prior to the start of a match. What would be the best way about going about that? I was under the impression that the pre_auton() function would work for it but I was unsure about the exact workings of it.

_________________
Member of the Sarah Heinz House VEX and FIRST teams.


Sat Jan 26, 2013 3:29 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.