BMI270 Accelerometer¶
The BMI270 accelerometer is the second most commonly used accelerometer on the available MbientLab boards. It comes with a gyroscrope giving 6 degrees of freedom.
import com.mbientlab.metawear.module.AccelerometerBmi270;
AccelerometerBmi270 accBmi270 = board.getModule(AccelerometerBmi270.class);
Output Data Rate¶
Available output data rates for the BMI270 device is enumerated by its OutputDataRate enum. You can use these entries to set the ODR to a known quantity.
import com.mbientlab.metawear.module.AccelerometerBmi270.OutputDataRate;
import com.mbientlab.metawear.module.AccelerometerBmi270.AccRange;
accBmi270.configure()
.odr(OutputDataRate.ODR_25_HZ) // set odr to 25Hz
.range(AccRange.AR_4G) // set range to +/-4g
.commit();