08-27-2024 04:07 PM
Hello, Is it possible to change the ANY MOTION sensitivity on BHI360 using the BHY2 API?
Best Resgards Bruno Horta
08-29-2024 01:26 PM
Yes, it is possible to change the ANY MOTION sensitivity on the BHI360 sensor using the BHY2 API. The BHI360 sensor, which is part of Bosch Sensortec’s sensor family, supports configuring various sensor settings, including the sensitivity of the ANY MOTION detection.
Thanks
08-29-2024 02:50 PM
You can send me one example?
2 weeks ago
Hi brunohorta2023,
Thank for your inquiry.
You can refer to the following any motion example on BHI360.
rslt = bhy2_register_fifo_parse_callback(BHY2_SENSOR_ID_ANY_MOTION_LP, parse_anymotion, (void*)&anymotion_accuracy, &bhy2dev);
print_api_error(rslt, &bhy2dev);
uint8_t am_cfg[BHI3_PHY_ANY_MOTION_CTRL_LEN];
uint16_t duration = 0x04;//under 50 Hz ODR, 80ms = 0x04*20ms
uint8_t axis = 0x7;//for x,y,z axis
uint16_t threshold = 0xAA;//83mg = 0xAA/0x800
am_cfg[0] = (duration & 0x00FF);
am_cfg[1] = (axis << 5) | ((duration >> 😎 & 0x1F);
am_cfg[2] = (threshold & 0x00FF);
am_cfg[3] = (threshold >> 8);
rslt = bhi3_set_anymotion_config(am_cfg, &bhy2dev);
print_api_error(rslt, &bhy2dev);
rslt = bhy2_set_virt_sensor_cfg(BHY2_SENSOR_ID_ANY_MOTION_LP, algo_sample_rate, algo_report_latency_ms, &bhy2dev);
print_api_error(rslt, &bhy2dev);
printf("Enable %s at %.2fHz.\r\n", get_sensor_name(BHY2_SENSOR_ID_ANY_MOTION_LP), algo_sample_rate);
printf("Any Motion Parameter set successfully \r\n");
void parse_anymotion(const struct bhy2_fifo_parse_data_info *callback_info, void *callback_ref)
{
int8_t rslt;
uint32_t tick;
tick = HAL_GetTick();
printf("%lu, enter parse_anymotion\r\n", tick);
}