4 releases
new 0.2.1 | Dec 1, 2024 |
---|---|
0.2.0 | Jun 25, 2024 |
0.1.1 | Sep 28, 2023 |
0.1.0 | Mar 13, 2023 |
#384 in Embedded development
130 downloads per month
7KB
128 lines
Adafruit STEMMA soil moisture sensor
A pure generic I2C crate for the Adafruit STEMMA soil moisture sensor
Usage
use stemma_soil_moisture_sensor::prelude::*;
fn main() -> Result<(), SoilMoistureSensorError> {
// Setup your I2C and import relevant delay
let sensor = SoilSensor::new(i2c, delay).with_units(TemperatureUnit::Fahrenheit);
// Full
let reading = sensor.read()?;
let temp = reading.temperature;
let moist = reading.moisture;
// Individual
let temp = sensor.temperature()?;
let moist = sensor.moisture()?;
}
Dependencies
~305–760KB
~17K SLoC