Hi,

Please help to understand how to convert gyroscope output to get it ratiometric.

I have a gyroscope: ADXRS401 from SparkFun connected to Arduino.

I read this piece of code from someones’ program, who unfortunately didn’t like to use parentheses!

```
conversion = 5.0 / 1024.0 * 1000 / 15 / 57.29578;
gyro = analogRead(gyroPin);
gyro = (gyro - 512.0) * conversion;
```

from the datasheet of the gyroscope:

Scale Factor: 15mV/deg/sec.

I only know that 5.0/1024.0 is for 4.88mV per bit ADC, and 57.29578 to convert from radian to degree and 1000 is to cancel ‘m’ which is milli(volt). I am confused by the order of operations: why it is multiplied by 1000/15, shouldn’t be 15/1000 as it is the scale factor?

please explain the conversion formula!

Thanks!