Crates.io | stemma_soil_moisture_sensor |
lib.rs | stemma_soil_moisture_sensor |
version | |
source | src |
created_at | 2023-03-13 22:27:47.827336 |
updated_at | 2024-12-01 18:31:08.809887 |
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 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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 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()?;
}