Struct bmp280::Bmp280Builder [−][src]
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
impl RefUnwindSafe for Bmp280Builder
impl Send for Bmp280Builder
impl Sync for Bmp280Builder
impl Unpin for Bmp280Builder
impl UnwindSafe for Bmp280Builder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,