Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BHY2 with BH360, ANY MOTION sensitivity

    BHY2 with BH360, ANY MOTION sensitivity

    Hello, Is it possible to change the ANY MOTION sensitivity on BHI360 using the BHY2 API?

     

    Best Resgards Bruno Horta

    3 REPLIES 3

    leenjas
    Member

    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

    You can send me one example?

    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);
    }

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist