A platform agnostic Rust driver for the MS8607 Pressure, Temperature, and Humidity Sensor from TE Connectivity.
Tested and works great with the Adafruit MS8607 Breakout Board :
There is an example for the Raspberry Pi Pico board in the examples
directory.
Using the ms8607
driver in your own project is possible with any platform that supports the embedded-HAL. See awesome-embedded-rust for a list of supported platforms.
In order to use the ms8607
driver you'll need to configure an I2C device that implements the embedded HAL blocking I2C traits. You'll also need a delay device that implements the embedded HAL blocking delay traits.
```rust // Create a new instance of the MS8607 driver let mut ms8607 = MS8607::new(); // Initialize and calibrate the sensor let begin = ms8607.begin(&mut i2c, &mut delay); // Init OK, sensor found.
// Get measurements let (pres, temp, hum) = ms8607.get_measurements(&mut i2c, &mut delay).unwrap(); writeln!( uart, "Pressure: {pres:.2} Pa, Temperature: {temp:.2} C, Humidity: {hum:.2} %RH\r" ) .unwrap(); ```
Written by Antoine Raulin for the HydroVinci's MicroTransat project, a student association at the ESILV.