Hi everyone, I have purchased the BMX160 shuttle board. Base on this API I've managed to receive some data with the time stamp. However, I have some questions:
1. How can I ensure that I am receiving the correct values from the magnetometer? I am receiving a constant value of 2047 on the z-axis, is this normal?
2. I am using the accel.sensortime to get the time stamp but I am not sure what is its returning type, is this microseconds? I am calling read_sensor_data() every one second.
This is the function I am calling to receive data.
struct bmi160_dev sensor; //For Accel and Gyro
struct bmm150_dev bmm150; //For Mag
struct bmi160_sensor_data accel;
struct bmi160_sensor_data gyro;
static void read_sensor_data() {
m_xfer_done = false;
bmi160_get_sensor_data((BMI160_ACCEL_SEL | BMI160_GYRO_SEL | BMI160_TIME_SEL), &accel, &gyro, &sensor);
bmi160_read_aux_data_auto_mode(mag_data, &sensor);
bmm150_aux_mag_data(mag_data, &bmm150);
NRF_LOG_INFO("Time:%d , AccelX:%d , AccelY:%d , AccelZ:%d",accel.sensortime, accel.x, accel.y, accel.z);
NRF_LOG_INFO("GyroX:%d , GyroY:%d , GyroZ:%d", gyro.x, gyro.y, gyro.z);
NRF_LOG_INFO("MagX:%d , MagY:%d , MagZ:%d", bmm150.data.x, bmm150.data.y, bmm150.data.z);
}
Solved! Go to Solution.
Hi Niko,
----No. it's abnormal. It seems signed or unsigned define issue in your code or driver.
----Sensortime is a 24-bit counter in register 0x18~0x1A. The sensortime increments with 39us. accuracy is same as the ODR.
Hi Shellywang
Thank you for your answer
----No. it's abnormal. It seems signed or unsigned define issue in your code or driver.
Could you please explain me what you mean by signed or unsigned define issue? Sorry, I am new to this and still learning 🙂
Anyone?