Go to Post Building things from scratch builds character. - davidthefat [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-01-2007, 20:03
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
EasyC: Execute code before autonomous

Hello,

Is there a way to execute code in a loop before the autonomous mode begins? I know that the help says you can not, but our team utilizes a dashboard, and it is very helpful to be able to send back the values of certain sensors to make sure they are working properly.

Does anyone have the experience with EasyC to help me out?

-Greg
  #2   Spotlight this post!  
Unread 07-01-2007, 20:05
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: EasyC: Execute code before autonomous

Maybe a loop in the initilization routine?
  #3   Spotlight this post!  
Unread 07-01-2007, 20:08
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: EasyC: Execute code before autonomous

Yes, just write the function you want to use and put it in intialize. It will execute any code in this function before the match starts. Check this thread out.

http://www.chiefdelphi.com/forums/sh...t=44749&page=2
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #4   Spotlight this post!  
Unread 07-01-2007, 20:14
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: EasyC: Execute code before autonomous

Quote:
Originally Posted by Kingofl337 View Post
Yes, just write the function you want to use and put it in intialize. It will execute any code in this function before the match starts. Check this thread out.

http://www.chiefdelphi.com/forums/sh...t=44749&page=2
So my understanding is, I need to create a while loop in Initialize that loops as long as IsAutonomous == 0 and IsEnabled == 0? That sounds like a slightly hackish solution, since WPIlib must be checking these variables to call Autonomous and OperatorControl anyway.
  #5   Spotlight this post!  
Unread 07-01-2007, 20:18
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: EasyC: Execute code before autonomous

You only need to call isEnabled to make sure the while loop ends and you don't get stuck in initialize. Initialize is run every time you reset your robot to calibrate any sensors that may need it.

Code:
void Initialize ( void )
{
      while ( !IsEnabled() ) // while the robot is not enabled
      {
            if ( GetOIDInput ( 1 , 1 ) ) // If Trigger is Pulled Go Next Auto
            {
                  automode ++ ;
            }
            else if ( GetOIDInput ( 1 , 2 ) ) // If Thumb is pushed go prev automode
            {
                  automode -- ;
            }
            SetUserDisplay ( automode ) ; // send current automode to OI display
      }
}
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 07-01-2007 at 21:29.
  #6   Spotlight this post!  
Unread 07-01-2007, 20:23
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: EasyC: Execute code before autonomous

Quote:
Originally Posted by Kingofl337 View Post
You only need to call isEnabled to make sure the while loop ends and you don't get stuck in initialize. Initialize is run every time you reset your robot to calibrate any sensors that may need it.

while ( !IsEnabled() ) {
your code

}
Excellent. Thanks!
  #7   Spotlight this post!  
Unread 07-01-2007, 21:15
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: EasyC: Execute code before autonomous

Quote:
Originally Posted by Kingofl337 View Post
You only need to call isEnabled to make sure the while loop ends and you don't get stuck in initialize. Initialize is run every time you reset your robot to calibrate any sensors that may need it.

Code:
void Initialize ( void )
{
      while ( IsEnabled() ) // while the robot is not enabled
      {
            if ( GetOIDInput ( 1 , 1 ) ) // If Trigger is Pulled Go Next Auto
            {
                  automode ++ ;
            }
            else if ( GetOIDInput ( 1 , 2 ) ) // If Thumb is pushed go prev automode
            {
                  automode -- ;
            }
            SetUserDisplay ( automode ) ; // send current automode to OI display
      }
}
Shouldn't that be:

Code:
 while ( !IsEnabled() ) // while the robot is not enabled
      {
            if ( GetOIDInput ( 1 , 1 ) ) // If Trigger is Pulled Go Next Auto
            {
                  automode ++ ;
            }
            else if ( GetOIDInput ( 1 , 2 ) ) // If Thumb is pushed go prev automode
            {
                  automode -- ;
            }
            SetUserDisplay ( automode ) ; // send current automode to OI display
      }
?
__________________
  #8   Spotlight this post!  
Unread 07-01-2007, 21:30
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: EasyC: Execute code before autonomous

yeah forgot the ! fixed thanks.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyC autonomous modes TubaMorg Programming 25 12-04-2006 22:53
EasyC Default Code Team 1649 Programming 13 29-01-2006 11:52
Help!!! 979 has no autonomous day before Buckeye dddriveman Programming 11 24-03-2004 12:16
Using a switch before autonomous operation KZos550 Programming 11 04-02-2003 19:12


All times are GMT -5. The time now is 21:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi