VersBinarii / bme280-rs

A platform agnostic Rust driver for the Bosch BM[PE]-280
Other
59 stars 73 forks source link

How to use without delay provider #42

Open redeexpressos opened 1 week ago

redeexpressos commented 1 week ago

Hi. I want to use this crate but it seems that ìnit needs a delay provider.

bme280::i2c::BME280
impl<I2C> BME280<I2C>
pub fn init<D>(&mut self, delay: &mut D) -> Result<(), Error<I2C::Error>>
where
    D: DelayNs,
    // Bounds from impl:
    I2C: I2c + ErrorType,

How can I provide, e.g, 1 second? Or init it without a delay and then I sleep in a loop after measuring? I want to run this on a small SoM computer running Linux, not a microcontroller/wtv.

VersBinarii commented 4 days ago

I believe you should be able to make it work with the Delay from embedded linux hal