Mita

The standard alias gyroscope refers to GyroscopeSensorFusion. The alias can not be changed, but the XDK gyroscopes can be used without SensorFusion using the respective handles:

  • Gyroscope_BMG160

  • Gyroscope_BMI160

The following code will read the three axes of the gyroscope sensor and print the values to the console every 100 milliseconds

  • it does not require any kind of initialization

every 100 milliseconds {
      var x = gyroscope.x_axis.read();
      var y = gyroscope.y_axis.read();
      var z = gyroscope.z_axis.read();
      println(x: ${x}    y: ${y}    z: ${z});
  }

Configuration

The BMG160 can be configured as follows:

setup Gyroscope_BMG160 {
  range = Range_250s;
  bandwidth = Bw_12Hz;
}

The BMI160 can be configured as follows:

setup Gyroscope_BMI160 {
  range = Range_250s;
  bandwidth = BW_10_7Hz;
}

Last updated

Was this helpful?