I am using this gyroscope to calculate the rotation of my robot.
Everything works fine however I struggle with identifying a specific value of a variable.
This is the code I use to calculate the change in angle:
void Robot::gyroCheck(float duration){
int values[3] = { 0, 0, 0 };
getGyroscopeReadings(values);
float angle = (values[0] - xOffset) * duration / 2.96;
totalAngle += angle;
}
Notice that I divide by 2.96 to get the correct angle.
I found this value by trial and error. I started with 10, changed to 5 and went down in steps until I got close and decreased the step size.
In however do not understand why I have to do this or if this is the correct value.
In some tutorial I noticed a similar technique by using such a constant and that guy named it the sensitivity of the sensor.
He calculated it by dividing the range of the sensor and the voltage change per step.
I however am not able to get the same information from the datasheet. Can someone give me some more info on this please.