Skip to content

Commit

Permalink
Add code to initialize gyroscope (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
samderanova authored May 29, 2024
1 parent af5c7cb commit b5bed4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pod-operation/src/components/gyro.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use mpu6050::Mpu6050;
use rppal::hal::Delay;
use rppal::i2c::I2c;

pub struct Gyroscope {
Expand All @@ -13,7 +14,8 @@ pub struct Orientation {
impl Gyroscope {
pub fn new() -> Self {
let i2c = I2c::new().unwrap();
let mpu6050 = Mpu6050::new(i2c);
let mut mpu6050 = Mpu6050::new(i2c);
mpu6050.init(&mut Delay::new()).unwrap();
Gyroscope { mpu6050 }
}

Expand Down

0 comments on commit b5bed4a

Please sign in to comment.