Trait Accelerometer

Source
pub trait Accelerometer {
    type Error: Debug;

    // Required methods
    fn accel_norm(&mut self) -> Result<F32x3, Error<Self::Error>>;
    fn sample_rate(&mut self) -> Result<f32, Error<Self::Error>>;
}
Expand description

Accelerometer trait which provides g-normalized readings.

Required Associated Types§

Source

type Error: Debug

Error type

Required Methods§

Source

fn accel_norm(&mut self) -> Result<F32x3, Error<Self::Error>>

Get normalized ±g reading from the accelerometer.

Ex. {0.0, 5.2, 0.0} - 5.2 g of acceleration in the y-axis

Source

fn sample_rate(&mut self) -> Result<f32, Error<Self::Error>>

Get sample rate of accelerometer data.

Ex. 125.0 - sample rate of 125hz

Implementors§