pub fn magnitude(
    lsm303agr: &mut Lsm303agr<I2cInterface<I2c<I2C1, (PB6<AF4>, PB7<AF4>)>>, mode::MagContinuous>,
) -> f32 {
    let take_readings = lsm303agr.mag_data().expect("Failed to read the values.");
    const XY_GAIN: f32 = 1100.;
    const Z_GAIN: f32 = 980.;
    let x = f32::from(take_readings.x) / XY_GAIN;
    let y = f32::from(take_readings.y) / XY_GAIN;
    let z = f32::from(take_readings.z) / Z_GAIN;
    let magnitude = (x * x + y * y + z * z).sqrt();
    magnitude
}
/// This function calculates the Magnitude of the Magnetic Field using x, y, z-axis readings.
///
/// #Input
/// Function magnitude takes a single input lsm303agr as package("Lsm303agr") type.
///
/// #Return
/// magnitude function return the calculated magnitude of the Magnetic Field.
This function calculates the Magnitude of the Magnetic Field using x, y, z-axis readings.
This function calculates the Magnitude of the Magnetic Field using x y z - axis readings .
pub fn magnitude(
    lsm303agr: &mut Lsm303agr<I2cInterface<I2c<I2C1, (PB6<AF4>, PB7<AF4>)>>, mode::MagContinuous>,
) -> f32 {
    let take_readings = lsm303agr.mag_data().expect("Failed to read the values.");
    const XY_GAIN: f32 = 1100.;
    const Z_GAIN: f32 = 980.;
    let x = f32::from(take_readings.x) / XY_GAIN;
    let y = f32::from(take_readings.y) / XY_GAIN;
    let z = f32::from(take_readings.z) / Z_GAIN;
    let magnitude = (x * x + y * y + z * z).sqrt();
    magnitude
}
pub fn magnitude ( lsm303agr : & mut Lsm303agr < I2cInterface < I2c < I2C1 , ( PB6 < AF4 > , PB7 < AF4 > ) > > , mode :: MagContinuous > , ) -> f32 { let take_readings = lsm303agr . mag_data ( ) . expect ( " " ) ; const XY_GAIN : f32 = 1100. ; const Z_GAIN : f32 = 980. ; let x = f32 :: from ( take_readings . x ) / XY_GAIN ; let y = f32 :: from ( take_readings . y ) / XY_GAIN ; let z = f32 :: from ( take_readings . z ) / Z_GAIN ; let magnitude = ( x * x + y * y + z * z ) . sqrt ( ) ; magnitude }
This function calculates the Magnitude of the Magnetic Field using x, y, z-axis readings.
This function calculates the Magnitude of the Magnetic Field using x y z - axis readings .
magnitude function return the calculated magnitude of the Magnetic Field.
magnitude function return the calculated magnitude of the Magnetic Field .
lsm303agr
&mut Lsm303agr<I2cInterface<I2c<I2C1, (PB6<AF4>, PB7<AF4>)>>, mode::MagContinuous>
input
Function magnitude takes a single input lsm303agr as package("Lsm303agr") type.
Function magnitude takes a single input lsm303agr as package ( " Lsm303agr " ) type .