Thread: execute.h
View Single Post
  #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, 25 views)