Skip to content

A pure generic I2C crate for the Adafruit STEMMA soil moisture sensor

License

Notifications You must be signed in to change notification settings

FloppyDisck/STEMMA_soil_moisture_sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adafruit STEMMA soil moisture sensor   Latest Version

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()?;
}

About

A pure generic I2C crate for the Adafruit STEMMA soil moisture sensor

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages