Motion detection

In the middle of my app I need to implement a motion detector for the sensor. I am currently streaming the accelerometer values and detecting the changes in my code. It looks like using the bosch detector in the chip itself would be more battery friendly since it would only stream when detecting the motion. Do you have a python example on using the mbl_mw_acc_bosch_enable_motion_detection callback?

Regards

Comments

  • Solved it...

            libmetawear.mbl_mw_acc_bosch_set_any_motion_count(self.device.board, 4)
            libmetawear.mbl_mw_acc_bosch_set_any_motion_threshold(self.device.board, 0.25)
            libmetawear.mbl_mw_acc_bosch_write_motion_config(self.device.board)
    
            signal = libmetawear.mbl_mw_acc_bosch_get_motion_data_signal(self.device.board)
            libmetawear.mbl_mw_datasignal_subscribe(signal, None, self.motion_callback)
    
            libmetawear.mbl_mw_acc_bosch_enable_motion_detection(self.device.board)
            libmetawear.mbl_mw_acc_bosch_start(self.device.board)
    
  • Nice!

Sign In or Register to comment.