Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gyro Heading always zero, yet operating? (http://www.chiefdelphi.com/forums/showthread.php?t=61260)

marccenter 10-01-2008 08:12

Gyro Heading always zero, yet operating?
 
Can I get some help in determining why the gyro heading is always ZERO but the gyro counts change when I swing the device? I have captured screen shots into powerpoint and will zip them, then attach to this message.

TubaMorg 10-01-2008 13:21

Re: Gyro Heading always zero, yet operating?
 
I had to look up the printTextToGD function call from WPLib.

Quote:

void PrintTextToGD(unsigned char ucRow, unsigned char ucCol, unsigned long ulColor, rom const char *szText, ...);
Usually when we have a problem like yours, it is a typecast problem.
Other things to check:
Is your color valid?
Is your gyro type set correctly? You have the 300 deg/sec gyro?
What affect does the wait(200) have on your program? I always prefer to wrap my print statements in a if block for what you are trying to do:

if (time%$200 == 0)
{
printTextToGD.....
}

That way the program can continue to process gyro data, although WPLib documentation implies that sensor data is still processed during the wait.

artdutra04 10-01-2008 14:26

Re: Gyro Heading always zero, yet operating?
 
Quote:

Originally Posted by marccenter (Post 674202)
Can I get some help in determining why the gyro heading is always ZERO but the gyro counts change when I swing the device? I have captured screen shots into powerpoint and will zip them, then attach to this message.

It sounds like the sensor is recording the change (derivative) and not the elapsed angle (integral).

If you want to get the elapsed angle, you can just add/subtract the difference every time through the loop to keep track of the absolute angle. You may have to do some simple calculations to make the sensor value you are getting back correspond directly with degrees rotated.

marccenter 16-01-2008 10:54

Re: Gyro Heading always zero, yet operating?
 
Hey guys, I finally got the gyro to work. It help's if you actually Start the thing.
Thread can be deleted, if desired by moderator. Thanks for CD help.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi