|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Timer Question
There is a global variable named "disabled_mode" that is set true for a while after autonomous_mode is set to true and your autonomous code will start. What will happen is you will turn on PWM output for the motors but nothing will happen because the robot is disabled. The 15 sec autonomous period does not start until disabled_mode is set to false.
Check out Mark's post on this thread. http://www.chiefdelphi.com/forums/sh... onomous_mode " Re: _mode flag summary?? -------------------------------------------------------------------------------- Last year we reset our autonomous whenever the robot was disabled. The drivers didn't have to remember to reset for the second practice match. Last year the actual sequence at the SBPLI Regional was: Disable bit set before the match started Both disable and autonomous bits set Then disable was turned off to start the autonomous mode Finally the autonomous bit went off as the user_mode came on One team had their autonomous timer ticking off while the robot was disabled at the beginning of the match, so the robot always thought it was partway or completely through the 15 seconds, before they were enabled and allowed to move." |
|
#2
|
|||
|
|||
|
Re: Timer Question
Quote:
if (disabled_mode) timer = 0; is the same as: if (disabled_mode == true) timer = 0; right? thanks again .Last edited by lightning_blast : 28-03-2007 at 23:38. |
|
#3
|
||||
|
||||
|
Re: Timer Question
For practical purposes, yes,
if(disabled_mode) // not disable_mode - my bad is really the same as if(disabled_mode != 0) If you look at ifi_default.h you will see the following defines: #define FALSE 0 #define TRUE !FALSE It might make more sense if the way you coded it was simply in your logic to increment timer if(!disabled_mode) // disabled_mode == FALSE timer += 1; |
|
#4
|
||||
|
||||
|
Re: Timer Question
If true = 1, then yes.
|
|
#5
|
|||||
|
|||||
|
Re: Timer Question
Quote:
|
|
#6
|
|||
|
|||
|
Re: Timer Question
thanks for all of your help guys
. im going to.. try out an autonomous tomorrow (GTR regionals ). i doubt we'll do so well but FIRST isnt all about winning right? ![]() |
|
#7
|
||||
|
||||
|
Re: Timer Question
Alan,
I don't know for a fact what the competition port sequence is this year but User_Autonomous_Code() gets called from main() if autonomous_mode is set regardless of the independent disabled_mode flag. It seems to me that to insure that Process_Data_From_Master_uP() is never called until the end of autonomous mode then disabled_mode and autonomous_mode would have to be set true at the same time. Maybe not for long but autonomous_mode has to already be set before disabled_mode is turned off. We aren't taking any chances so we wait until disabled_mode is turned off and autonomous_mode is turned on to start our autonomous play. Do you know what the timing is for 2007? |
|
#8
|
|||||
|
|||||
|
Re: Timer Question
Quote:
Quote:
|
|
#9
|
||||
|
||||
|
Re: Timer Question
Quote:
|
|
#10
|
|||||
|
|||||
|
Re: Timer Question
My post applied to earlier field control. I found it to have changed to what Alan saw 2005 and after.
(I'm waiting for my teenager to leave for our regional this morning. Did I ever take this long to get ready in the morning?) Last edited by Mark McLeod : 30-03-2007 at 07:15. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Timer questions | Rick TYler | Programming | 3 | 12-02-2006 19:24 |
| Quick Timer Question | et1337 | Programming | 3 | 02-02-2006 15:19 |
| Accelerometer Timer Question | psquared | Programming | 3 | 12-02-2005 01:34 |
| timer | omega | Programming | 3 | 30-03-2004 18:52 |
| Timer Preview | Nate Smith | General Forum | 2 | 05-03-2003 12:25 |