|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Help with Kevin Watson's 2008 code
The project did build but as soon as I added pwm01 = p1_y; It would not build as shown below.
void Teleop(void) { pwm01 = p1_y; // example code to test your gyro and encoder(s) long Encoder_Count; static unsigned int i = 0; static unsigned int j = 0; int temp_gyro_rate; long temp_gyro_angle; int temp_gyro_bias; i++; j++; // this will rollover every ~1000 seconds // enable this block of code to test your gyro if(j == 10) { printf("\r\nCalculating Gyro Bias...\r\n"); } if(j == 38) // let the gyro stablize for a second before starting a calibration { // start a gyro bias calculation Start_Gyro_Bias_Calc(); } if(j == 191) // allow calibration routine to run for four seconds { // terminate the gyro bias calculation Stop_Gyro_Bias_Calc(); // reset the gyro heading angle Reset_Gyro_Angle(); temp_gyro_bias = Get_Gyro_Bias(); printf("Gyro Bias=%d\r\n", temp_gyro_bias); } if(i == 35 && j >= 191) { temp_gyro_rate = Get_Gyro_Rate(); temp_gyro_angle = Get_Gyro_Angle(); printf(" Gyro Rate=%d\r\n", temp_gyro_rate); printf("Gyro Angle=%d\r\n\r\n", (int)temp_gyro_angle); } /* // enable this block of code to test your encoder(s) if(i == 37 && j >= 191) { Encoder_Count = Get_Encoder_1_Count(); printf("E1=%d\r\n",(int)Encoder_Count); Encoder_Count = Get_Encoder_2_Count(); printf("E2=%d\r\n",(int)Encoder_Count); Encoder_Count = Get_Encoder_3_Count(); printf("E3=%d\r\n",(int)Encoder_Count); Encoder_Count = Get_Encoder_4_Count(); printf("E4=%d\r\n",(int)Encoder_Count); Encoder_Count = Get_Encoder_5_Count(); printf("E5=%d\r\n",(int)Encoder_Count); Encoder_Count = Get_Encoder_6_Count(); printf("E6=%d\r\n\r\n",(int)Encoder_Count); } */ // reset the loop counter if(i >= 38) { i = 0; } // enable this to use IFI's default robot code // Default_Routine(); // located in ifi_code.c // update the state of the LEDs on the operator interface Update_OI_LEDs(); // located in ifi_code.c } |
|
#2
|
||||
|
||||
|
Re: Help with Kevin Watson's 2008 code
Quote:
int temp_gyro_bias; |
|
#3
|
|||
|
|||
|
Re: Help with Kevin Watson's 2008 code
Thanks for the help we'll try that please check back as I'm sure we'll have more questions
|
|
#4
|
||||||
|
||||||
|
Re: Help with Kevin Watson's 2008 code
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kevin watson's sensor code | DustinB_3 | Programming | 3 | 30-01-2008 21:07 |
| Problem compiling Kevin Watson's code | Spencer E. | Programming | 2 | 07-01-2008 00:34 |
| Trouble using Kevin Watson's Serial Code with Vex user API | StargateFan | Programming | 3 | 13-01-2007 15:42 |
| Kevin Watson's encoder code with RPM output | MaxM | Programming | 2 | 05-02-2005 00:06 |
| Kevin Watson's Kick-off Demo Code! | Mr. Lim | Programming | 27 | 22-01-2005 03:38 |