0

Github: \BMI270-Sensor-API-master\BMI270-Sensor-API - master\bmi270_legacy_examples\accel_gyro\accel_gyro.c

/*!

  • @brief This function converts lsb to meter per second squared for 16 bit accelerometer at
  • range 2G, 4G, 8G or 16G. */ static float lsb_to_mps2(int16_t val, float g_range, uint8_t bit_width) {    float half_scale = ((float)(1 << bit_width) / 2.0f);

   return (GRAVITY_EARTH * val * g_range) / half_scale; }

Formula usage

  /* Converting lsb to meter per second squared for 16 bit accelerometer at 2G range. */   x = lsb_to_mps2(sensor_data.acc.x, 2, bmi2_dev.resolution);

  bmi2_dev.resolution = 16

Hello All,

I am trying to understand why in the conversion formula below, a 'half scale' range is used instead of 'full scale' range.

Thank you in advance

Best regards

erode
  • 19
  • 2

0 Answers0