Struct bmp280::Bmp280Builder[][src]

pub struct Bmp280Builder { /* fields omitted */ }

A builder for Bmp280 sensors.

use bmp280::Bmp280Builder;
let mut sensor = Bmp280Builder::new()
    .address(0x20) // Optional
    .path("/dev/i2c-1") // Optional
    .build().expect("Could not build device");

let altitude = sensor.altitude_m();

Implementations

impl Bmp280Builder[src]

pub fn new() -> Self[src]

pub fn address(&mut self, address: u16) -> &mut Self[src]

Set the address of the I2C device for the sensor. There is a default value for this, so you do not need to specify it explicitly.

pub fn path(&mut self, path: impl Into<PathBuf>) -> &mut Self[src]

Set the path of the I2C device for the sensor. There is a default value for this, so you do not need to specify it explicitly.

pub fn ground_pressure(&mut self, pressure: f32) -> &mut Self[src]

Set the ground pressure for the sensor. If you do not specify this, the altitude will be zeroed when you call .build().

pub fn build(&self) -> Result<Bmp280>[src]

Attempt to build a Bmp280 sensor from this builder.

Trait Implementations

impl Default for Bmp280Builder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.