Accelerometer and gyroscope
I have recently bought a Metamotion R 10 IMU axis module and am having problems with the coding part, Can you provide a proper documentation of the accelerometer and gyroscope codes cause the available documentation codes arent being debugged by the android studio and multiple errors are shown because of the new 3.0.0 update. Kindly send me a detailed syntax documentation on BMI160 accelerometer and gyroscope.
This discussion has been closed.
Comments
applyfunction. This is illustrated in the Accelerometer section of the documentation..dataparameter. Again, see the example code in the Accelerometer section:public void configure(RouteComponent source) {
source.stream(new Subscriber() {
@Override
public void apply(Data data, Object... env) {
final SensorFusionBosch.CorrectedAngularVelocity value1 = data.value(SensorFusionBosch.CorrectedAngularVelocity.class);
if((value1.x()>100||value1.x()<-100)&&(value1.y()>100||value1.y()<-100)&&(value1.z()>100||value1.z()<-100)) {
b=1;
}
if(a==1&&b==1)
{
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();
}
Log.i("MainActivity", "Ang = " + data.value(SensorFusionBosch.CorrectedAngularVelocity.class));
}
});
}
}).continueWith(new Continuation<Route, Void>() {
@Override
public Void then(Task<Route> task) throws Exception {
sensorFusion.correctedAngularVelocity().start();
sensorFusion.start();
return null;
}
});
return null;
});