Trouble handling motion events
When the board is connected to the phone, then I have no problem handling motion events, e.g. turning on the LED when motion is detected then listening for no motion. However, I would like this to happen even when the phone is not connected. The following code won't work if the board isn't connected with the phone. Any ideas?
motionModule.routeData().fromMotion().monitor(new DataSignal.ActivityHandler() {
@Override
public void onSignalActive(Map<String, DataProcessor> map, DataSignal.DataToken dataToken) {
//startSensors();
//settingsModule.startAdvertisement();
//mwBoard.connect();
turnOnLed(Led.ColorChannel.BLUE);
Log.d(TAG, "MOTION DETECTED");
//beaconModule.configure().setAdPeriod(advertisementPeriod).commit();
//beaconModule.enable();
startNoMotionDetection();
}
}).commit();
motionModule.enableMotionDetection(Bmi160Accelerometer.MotionType.ANY_MOTION);
motionModule.configureAnyMotionDetection().setThreshold(0.1f).commit();
motionModule.startLowPower();
This discussion has been closed.
Comments