Re: Can someone give me some code for the gyro
What gyro? Does it provide raw data or euler angles? (http://en.wikipedia.org/wiki/Euler_angles
It takes some math, to turn 90 degrees using the encoders. Code for this is included in my lib at http://www.spiked3.com/?p=410
The more common basic way to do it is to simply wait an amount of time previously determined by trial and error.
So an example might be;
with a gyro is a whole new model
In theory, you read the turn rate sample, multiply that by elapsed time, accumulate to an actual amount turned variable, (optionally fuse with compass heading and encoder data), lower power to 0 as you approach 90 degrees. That's the theory anyhow. I have that as an upcoming project as well. Please let me know if you find something else.