Quote:
|
Originally Posted by TubaMorg
I can't seem to figure out the answer for two things.
1. EasyC gyro code seems to work well, giving the correct heading when the robot is turned. However we would like to use the actual yaw rate...how can we access this data?
|
As you said in your other post, you can retrieve the raw yaw rate just polling the gyro analog port directly. It returns 12.5mv/deg/sec of rotation. The analog to digital converter returns a value from 0-1024 for the range of 0-5000mv. So by doing some arithmetic, you can create a function that returns the actual rate of rotation directly.
Quote:
|
Originally Posted by TubaMorg
I can't seem to figure out the answer for two things.
2. We tried to calculate yaw rate ourselves using one of the EasyC timers, however the timer doesn't seem to change. We start it in the Initialize block but subsequent calls return 0, thus we still can't get yaw rate.
|
Can you try putting in a print statement when the timer is started and another when you are reading the timer just to verify that it is being started? Also, are you doing a Preset operation on the timer anywhere in your code that might be getting unintentionally executed repeatedly?