No motion detection duration/threshold

I would like to get notified once the 'C' has not been moved / no motion for a certain period of time. Let's say no major movement for 60 seconds. I would use this to detect "sleep" for example for a fitness tracker. 

setDuration adn setThreshold both accept int values  - what are the meanings of these. For Duration, it's ms? 

bmi160AccModule.configureNoMotionDetection().setDuration(10).setThreshold(5);

Comments

  • I currently use this now, but I get a ton of "motion" events. I would expect an event once no motion happened for the 10 seconds specified... Any ideas?

    bmi160AccModule.start();
    bmi160AccModule.enableStepDetection();
    bmi160AccModule.enableTapDetection(Bmi160Accelerometer.TapType.DOUBLE);
    bmi160AccModule.enableMotionDetection(Bmi160Accelerometer.MotionType.NO_MOTION);

    bmi160AccModule.configureNoMotionDetection().setDuration(10000).commit();


    I think in general, what would really help me is to know the sensitive default values for a lot of these motion features. Are these somewhere?
  • All sensor configurations must be made before you start the accelerometer; the start function is the last function to call.

    Motion default values are listed on the BMI160 spec sheet section 2.11.25.  Your best bet however, is to find the settings that work best and not rely on the default values.
  • thx @Eric, that's great to know!
This discussion has been closed.