03-03-2022 09:17 AM
How should several registers of mag be configured? What do the bits of these registers represent? How should these registers be configured to make the geomagnetic needle work normally?
03-04-2022 06:52 AM
Hello Nigel_Zhu,
Please refer to the following codes in the attachment to get mag data.
#if defined(DATA_POLL)
for(;;)
{
#if 0
/* To read only Accel data */
rslt = bmi160_get_sensor_data(BMI160_ACCEL_SEL, &accel, NULL, dev);
/* To read only Gyro data */
rslt = bmi160_get_sensor_data(BMI160_GYRO_SEL, NULL, &gyro, dev);
#else
/* To read both Accel and Gyro data */
bmi160_get_sensor_data((BMI160_ACCEL_SEL | BMI160_GYRO_SEL), &accel, &gyro, dev);
#endif
PDEBUG("ACCEL X : %d , Y : %d , Z : %d\r\n", accel.x, accel.y, accel.z);
PDEBUG("GYRO X : %d , Y : %d , Z : %d\r\n", gyro.x, gyro.y, gyro.z);
vGetMagData(dev);
vTaskDelay(1000);
}
#endif
03-04-2022 10:58 AM
This is to obtain the data of accelerometer and gyroscope. I want the data of geomagnetic needle, and you haven't answered me directly about how to configure the relevant registers of geomagnetic needle. You haven't given me a definite answer about which registers to configure. What registers should be configured to configure the geomagnetic needle sensor? What parameters need to be configured?
03-09-2022 08:49 AM
Hello Nigel_Zhu,
vGetMagData(dev) is a function call to obtain geomagnetic data.
The example code calls the function of sensor API, which contains how to access registers.
03-10-2022 09:20 AM
vGetMagData(dev);Which function is implemented in the file? Why can't I find the definition or declaration of this function?
03-15-2022 10:02 AM
Hello Nigel_Zhu,
Suggest you look at the code previously sent in the attachment.