08-20-2022 02:24 PM
Hi Team,
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.
08-21-2022 02:08 PM
Hi vamshi,
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))
08-22-2022 06:43 AM
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?
Thank you
08-25-2022 07:05 AM
Hi @BSTRobin,
Could you please give clarity on the above query? As we were unable to find scale factors changing process in the present working code.
Any help would be very thankful.
08-29-2022 10:26 AM
Hi vamshi,
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,
uint16_t dynamic_range)