Gyroscope Advanced Usage

Raw And Translated Data

Raw and translated rotation datas are available. Calling mpu925x_get_rotation function also calls mpu925x_get_rotation_raw function internally. Both functions stores data in given mpu925x_t struct.

void mpu925x_get_rotation(mpu925x_t *mpu925x)

Get rotation in degrees per second.

See also

mpu925x_get_rotation_raw

Parameters

mpu925x – MPU-925X struct pointer.

void mpu925x_get_rotation_raw(mpu925x_t *mpu925x)

Get raw rotation data.

See also

mpu925x_get_rotation

Parameters

mpu925x – MPU-925X struct pointer.

Full-Scale Select

One can set gyroscope full-scale range of 250 dps, 500 dps, 1000 dps and 2000 dps.

void mpu925x_set_gyroscope_scale(mpu925x_t *mpu925x, mpu925x_gyroscope_scale scale)

Set gyroscope full-scale range.

Parameters
  • mpu925x – MPU-925X struct pointer.

  • scale – Gyroscope full-scale range to be set.

enum mpu925x_gyroscope_scale

Gyroscope full-scale ranges for gyroscope.

Values:

enumerator mpu925x_250dps
enumerator mpu925x_500dps
enumerator mpu925x_1000dps
enumerator mpu925x_2000dps

Digital Low Pass Filter

One can enable hardware digital low pass filter. Look datasheet for more info.

void mpu925x_set_gyroscope_dlpf(mpu925x_t *mpu925x, uint8_t a_fchoice, uint8_t dlpf)

Set gyroscope digital low pass filter setting.

Parameters
  • mpu925x – MPU-925X struct pointer.

  • g_fchoice – Gyroscope f_choice bits.

  • dlpf – Digital low pass filter setting.

Offset Cancellation

Offset cancellation consist 2 steps: Getting and setting offset cancellation values. While getting offset cancellation values, sensor must stand still.

void mpu925x_get_gyroscope_offset(mpu925x_t *mpu925x, uint16_t sampling_amount, int16_t *offset)

Get gyroscope offset cancellation values.

See also

mpu925x_set_gyroscope_offset

Parameters
  • mpu925x – MPU-925X struct pointer.

  • sampling_amount – Sampling amount for rotation values.

  • offset – 3d array which holds gyroscope offset cancellation values.

void mpu925x_set_gyroscope_offset(mpu925x_t *mpu925x, int16_t *offset)

Set gyroscope offset cancellation values.

See also

mpu925x_get_gyroscope_offset

Parameters
  • mpu925x – MPU-925X struct pointer.

  • offset – 3d array which holds gyroscope offset cancellation values.

One can use these two methods to get and set offset values or call one unified function which does 2 of them at once.

void mpu925x_gyroscope_offset_cancellation(mpu925x_t *mpu925x, uint16_t sampling_amount)

Get and set gyroscope offset cancellation values.

See also

mpu925x_get_gyroscope_offset

See also

mpu925x_set_gyroscope_offset

Parameters
  • mpu925x – MPU-925X struct pointer.

  • sampling_amount – Sampling amount for rotation values.