SparkFun Soil Moisture Sensor  v00.09.00-32-g3ccbaeb
Library for the SparkFun Soil Moisture Sensor
Loading...
Searching...
No Matches
SparkFunSoilMoistureSensorI2C Class Reference

#include <SparkFun_Soil_Moisture_Sensor.h>

Inheritance diagram for SparkFunSoilMoistureSensorI2C:

Public Member Functions

bool begin (const uint8_t address=SFE_SOIL_MOISTURE_DEFAULT_I2C_ADDRESS, TwoWire &wirePort=Wire)
 Begins the Device. More...
 
bool isConnected ()
 Checks if the Device is connected. More...
 
- Public Member Functions inherited from sfeDevSoilMoisture
 sfeDevSoilMoisture ()
 
sfeTkError_t begin (sfeTkIBus *theBus=nullptr)
 Start the driver/begin connecting/comms to the device. More...
 
sfeTkError_t LEDOff (void)
 Turns off the on-board LED. More...
 
sfeTkError_t LEDOn (void)
 Turns on the on-board LED. More...
 
uint16_t readMoistureValue (void)
 Reads the moisture value from the sensor. More...
 
float readMoistureRatio (void)
 Reads the sensor value and returns the moisture ratio from the sensor (0 - 1.0) More...
 
float readMoisturePercentage (void)
 Reads the sensor value and returns the moisture percentage from the sensor (0 - 100%) More...
 
sfeTkError_t changeSensorAddress (uint8_t newAddress)
 Changes the I2C address of the sensor. More...
 

Additional Inherited Members

- Protected Attributes inherited from sfeDevSoilMoisture
sfeTkIBus * _theBus
 

Member Function Documentation

◆ begin()

bool SparkFunSoilMoistureSensorI2C::begin ( const uint8_t  address = SFE_SOIL_MOISTURE_DEFAULT_I2C_ADDRESS,
TwoWire &  wirePort = Wire 
)
inline

Begins the Device.

Parameters
addressI2C device address to use for the sensor
wirePortWire port to use for I2C communication
Returns
True if successful, false otherwise

◆ isConnected()

bool SparkFunSoilMoistureSensorI2C::isConnected ( )
inline

Checks if the Device is connected.

Returns
True if the sensor is connected, false otherwise

The documentation for this class was generated from the following file: