Crates.io | stemma_soil_moisture_sensor |
lib.rs | stemma_soil_moisture_sensor |
version | 0.2.0 |
source | src |
created_at | 2023-03-13 22:27:47.827336 |
updated_at | 2024-06-25 04:39:54.065587 |
description | A pure generic I2C crate for the Adafruit STEMMA soil moisture sensor |
homepage | |
repository | https://github.com/FloppyDisck/STEMMA_soil_moisture_sensor |
max_upload_size | |
id | 809304 |
size | 8,583 |
A pure generic I2C crate for the Adafruit STEMMA soil moisture sensor
use stemma_soil_moisture_sensor::prelude::*;
fn main() -> Result<(), SoilMoistureSensorError> {
// Setup your I2C and import relevant delay
let i2c = ...;
let moisture = SoilSensor::new(i2c, Delay).with_units(TemperatureUnit::Fahrenheit);
let temp = moisture.temperature()?;
let moist = moisture.moisture()?;
}