View Single Post
  #13   Spotlight this post!  
Unread 15-11-2005, 01:00
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: EDU Mini Controller & 2005 Nav Code

Quote:
Originally Posted by prograid
I'm not sure about this, but I believe that the EDU controller shares pins for digital and analog inputs. You need to set the input your gyro is plugged into to be an analog input in user_initialization() which is user_routines.c.

Good Luck!
Considering he gets a valid gyro bias and rate, the problem is not the reading.

jaustin,

gyro_angle is declared as a long in Kevin's code. The comments section of printf_lib.c states that you should use %lx, but I have never tried that.
What will work (and what Kevin's code does in another section) is to type-cast the long variable. You should print it like that:
Code:
temp_gyro_angle = Get_Gyro_Angle();
printf("Gyro Angle=%d\r\r", (int)temp_gyro_angle);
Depending on what compiler version you're using, it should be \r or \n.
Anyway, on your code you're printing three times inside the Process_Gyro_Data function. This is an interrupt service routine, and it should be processed as fast as possible. Printf takes a lot of time, and it is unwise to use it three times (actually, to use it at all) inside an ISR.
Check user_routines.c on Kevin's code, there are some examples that will print exactly what you want without "side effects".
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383

Last edited by Manoel : 15-11-2005 at 01:03.