Go to Post If you water it and nurture it and fertilize it and put it out in the sunlight, it might just grow up to be a big lathe... :) - dlavery [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 10-03-2007, 20:21
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Question execute.h

I am currently working on the structure of the autonomous mode. I created an autonomous code structure in execute.c Is it possible so that i can call Do_execute(); in autonomous mode and it will work? In execute.c I am using many of gyro and encoder functions. So when I move them to autonomous in useroutines_fast.c. will all those gyro and encoder functions will work?
  #2   Spotlight this post!  
Unread 10-03-2007, 20:28
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,280
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: execute.h

You should be able to, there is no difference (ok this isn't completely true but close enough so you can assume it is) between calling a function and just copying and pasting it into the code.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #3   Spotlight this post!  
Unread 10-03-2007, 21:02
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: execute.h

here in the attachment is my execute. c

and i want to call the function in userroutines_fast.c, so this is what i am doing:
while (autonomous_mode) /* DO NOT CHANGE! */
{
// new ADC data available?
if(Get_ADC_Result_Count())
{
Process_Gyro_Data();
Reset_ADC_Result_Count();
}
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

/* Add your own autonomous code here. */
/******* 1219 Autonomous Code Starts Here*********************/

i++;
j++; // this will rollover every ~1000 seconds

if(j == 60)
{
// start a gyro bias calculation
Start_Gyro_Bias_Calc();
}

if(j == 300)
{
// terminate the gyro bias calculation
Stop_Gyro_Bias_Calc();

// reset the gyro heading angle
Reset_Gyro_Angle();

printf("Done\r");
}

if(i >= 30 && j >= 300)
{
temp_gyro_bias = Get_Gyro_Bias();
temp_gyro_rate = Get_Gyro_Rate();
temp_gyro_angle = (Get_Gyro_Angle()/100);
printf(" Gyro Bias=%d\r\n", temp_gyro_bias);
printf(" Gyro Rate=%d\r\n", temp_gyro_rate);
printf("Gyro Angle=%d\r\n\r\n", (int)temp_gyro_angle);

i = 0;
}
/*************GYRO CODES ENDS HERE ***************/

/************Processing Camera Information************/
Tracking_Info_Terminal();
Camera_Handler();
Servo_Track();
/********Camera Processing Ends Here********/

if(Get_Tracking_State() == CAMERA_ON_TARGET)
{

Do_executive(); // Runs the function from execute.c
}

PWM(pwm13,pwm14,pwm15,pwm16);
Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}
Attached Files
File Type: c executive.c (15.4 KB, 26 views)
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: Execute code before autonomous Greg Marra Programming 7 07-01-2007 21:30
How I can execute Javascript into Perl? TomS Programming 3 22-08-2006 16:35


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