Hello,
We have api to calculate accel value, from LSB to m/s2, as bellow. No matter which range selected, when keep accel flat, z-axis output is 9.8 m/s2.
#define GRAVITY_EARTH (9.80665f) /* Earth's gravity in m/s^2 */
/*! * @brief This internal API is used to convert lsb to ms2 * * @param[in] val: value * @param[in] range: range value * @param[in] bit_width * * @return float value in ms2 * */ float lsb_to_ms2(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; }
... View more