I'm using this LISY300AL Gyro: DataSheet
But i cant get a precise data..
Here is my calculation:
sensitivity = 0.716454545; gyroAdc = analogRead(0); if(abs(gyroAdc - gyroZero) <= Threshold) gyroAdc = gyroZero; gyroRate = (gyroAdc-gyroZero)/sensitivity; gyroRotation=gyroRotation+gyroRate*dtime1/1000; gyroAngle = abs((gyroRotation - 360 * ceil(gyroRotation / 360))); // Round up between 0-360 dtime = millis() - stime; // millis() is the milliseconds since my controller started stime = millis();
I dont get a precise angle, i move my object 90 degrees but the gyro drifts too much so it showes something else...
Maybe i'm doing something wrong ? or i should just add an Accelerometer to make it more precise ?