Thread: Yaw Sensor
View Single Post
  #6   Spotlight this post!  
Unread 12-02-2004, 12:07
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,847
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Yaw Sensor

Quote:
Originally Posted by Phil_Lutz
But even with the sensor reading 137, when we move the sensor in ANY direction, tilting up/down, or rotating left/right, no change in the 137 value.....


Thanks,

Phil
As a double check here is the test code we used on the EDU controller.
Hold the gyro level and twist it quickly 90 degrees or more in the horizontal plane.

Code:
// this assumes in User_Initialization() at least...
IO1 = INPUT;
Set_Number_of_Analog_Channels(ONE_ANALOG);
 
 
 
// in Process_Data_From_Master_uP():
 
unsigned int gyro;
static unsigned long gyroSum=0;
static unsigned int counter=0;
 
/* This sample assumes a 26.2ms loop */
gyro = Get_Analog_Value(rc_dig_in01);
gyroSum += gyro;
counter++;
 
if (counter > 40)
{
	gyroSum = gyroSum/counter;
	printf(" gyro = %d \n", (int)gyroSum); /* values are in the range 0-1023 */
	counter = 0;
	gyroSum = 0;
}
[edit] Fixed small bug in printf. We use different print functions, Sorry.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 13-02-2004 at 10:13.