Synopsis
CTL_STATUS_t ctl_gyroscope_set_range(CTL_GYROSCOPE_t *self,
                                     int range);
Description

ctl_gyroscope_set_range sets the range of the gyroscope g to operate between plus and minus range degrees per second. The gyroscope selects the range which is closest to range, but may exceed it if range degrees per second is not a setting offered by the gyroscope.

After successfully executing ctl_gyroscope_set_range, the range, gain, and bias members are updated to reflect the new setting. Note that these members are typical and are uncalibrated. You may wish to run a calibration after setting the range to reflect the particular gain and bias coefficients for your sensor.

Return Value

ctl_gyroscope_set_range returns a standard status code.

Thread Safety

ctl_gyroscope_set_range is thread-safe if the method set_range is thread-safe. Typically, for SPI and I2C transports, you ensure thread safety by associating a mutex with the bus used by the transport.