We are working on BHI160B IMU using STM32-L053R8 and Arduino code provided by Bosch. Present we are able to read data with default scale factors of Acc, Gyro, and Mag. Now, we need to change default scale factors ranges to our own. But, in BHI160B Datasheet unable to understand what values have to write to the registers for setting Acc, Gyro, and Mag scale factors (like Sample rates).
Is that possible to change those scale factors? If Yes,
Can anyone please guide me to change the default scale factors to our own (Acc, Gyr, Mag) ranges?
Any help would be very thankful.
You could use BHI160 sensor API from here: https://github.com/BoschSensortec/BHy1_driver_and_MCU_solution
The third parameter of the function bhy_enable_virtual_sensor() is to set the sampling rate of the virtual sensor.
#define GAME_ROTATION_VECTOR_SAMPLE_RATE 100
bhy_enable_virtual_sensor(VS_TYPE_GAME_ROTATION_VECTOR, VS_WAKEUP, GAME_ROTATION_VECTOR_SAMPLE_RATE, 0, VS_FLUSH_NONE, 0, 0))
Thank you for the reply @BSTRobin,
What about Accelerometer and Gyroscope scale factors?
"#define GAME_ROTATION_VECTOR_SAMPLE_RATE 100"
"bhy_enable_virtual_sensor(VS_TYPE_GAME_ROTATION_VECTOR, VS_WAKEUP, GAME_ROTATION_VECTOR_SAMPLE_RATE, 0, VS_FLUSH_NONE, 0, 0))"
Do the above changes affect Acc, Gyro sample rates?
You could refer "11.4 Sensor Configuration Structure" and sensor API to set dynamic range.
You could see the last parameter dynamic_range in function bhy_enable_virtual_sensor() can set range.
BHY_RETURN_FUNCTION_TYPE bhy_enable_virtual_sensor(bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status,
uint16_t sample_rate, uint16_t max_report_latency_ms,
uint8_t flush_sensor, uint16_t change_sensitivity,