1
Fork 0

update example

This commit is contained in:
Julian Gaal 2019-04-23 16:31:02 +02:00 committed by GitHub
parent 5398f1d472
commit 6079fb4cd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,6 +23,11 @@ fn main() -> Result<(), Error<LinuxI2CError>> {
let mut mpu = Mpu6050::new(i2c, delay);
mpu.init()?;
mpu.soft_calib(100)?;
mpu.calc_variance(50)?;
println!("Calibrated with bias: {:?}", mpu.get_bias().unwrap());
println!("Calculated variance: {:?}", mpu.get_variance().unwrap());
loop {
// get roll and pitch estimate