Go to Post ...there is just something that I like about the smell of fresh engine oil... - Matt Attallah [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 09-02-2008, 09:47
FireJet FireJet is offline
Registered User
AKA: Jero Sutlovic
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Burlington, Ontario
Posts: 8
FireJet is an unknown quantity at this point
2008 Gyro Code

Hi. I'm using Kevin's new 2008 code, but I can't figure out how to get the Gyro working in either autonomous mode or user mode. I believe that I set up the code right:

Code:
void Teleop_Init(void)
{
	Initialize_Gyro();
	
	if (Get_Gyro_Bias_Status() == GYRO_BIAS_NOT_DONE)
	{
		Start_Gyro_Bias_Calc();
		
		
		while (t2 < 76)
		{
			printf("Calculating gyro bias. State: %d.\n\r", Get_Gyro_Bias_Status());
			//Start_Gyro_Bias_Calc();
			t2++;
		}
		

		Stop_Gyro_Bias_Calc();
		
		printf("Gyro bias calculated: %ld.\n\r", Get_Gyro_Bias());
		
	}

}
Code:
void Teleop(void)
{
    ...

    	Process_Gyro_Data();
	tmpangle = Get_Gyro_Angle();
	printf("Gyro Angle %d\n\r", tmpangle);

    ...
}

But unfortunately, the only output I get is "Gyro Angle 0". I'm sure I've got the gyro connected right, as I get values from Get_Analog_Value (and they change), but I don't get anything from Kevin's code. Can anyone help?
 


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
Gyro code problem AMIRAM Programming 10 23-01-2006 04:26
problems using gyro/adc code with camera default code tanstaafl Programming 7 22-01-2006 23:09
gyro code odin892 Programming 2 08-04-2003 14:50
Gyro Chip Code archiver 2001 4 24-06-2002 00:57


All times are GMT -5. The time now is 23:51.

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