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

#include <sfeDevSoilMoisture.h>

Inheritance diagram for sfeDevSoilMoisture:

Public Member Functions

 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...
 

Protected Attributes

sfeTkIBus * _theBus
 

Constructor & Destructor Documentation

◆ sfeDevSoilMoisture()

sfeDevSoilMoisture::sfeDevSoilMoisture ( )
inline

Member Function Documentation

◆ begin()

sfeTkError_t sfeDevSoilMoisture::begin ( sfeTkIBus *  theBus = nullptr)

Start the driver/begin connecting/comms to the device.

Parameters
theBusA pointer to an I2C toolkit object
Returns
kSTkErrOk if successful, otherwise an error code

◆ changeSensorAddress()

sfeTkError_t sfeDevSoilMoisture::changeSensorAddress ( uint8_t  newAddress)

Changes the I2C address of the sensor.

Parameters
newAddressThe new I2C address to assign to the sensor
Returns
kSTkErrOk if successful, otherwise an error code

◆ LEDOff()

sfeTkError_t sfeDevSoilMoisture::LEDOff ( void  )

Turns off the on-board LED.

Returns
kSTkErrOk if successful, otherwise an error code

◆ LEDOn()

sfeTkError_t sfeDevSoilMoisture::LEDOn ( void  )

Turns on the on-board LED.

Returns
kSTkErrOk if successful, otherwise an error code

◆ readMoisturePercentage()

float sfeDevSoilMoisture::readMoisturePercentage ( void  )

Reads the sensor value and returns the moisture percentage from the sensor (0 - 100%)

Returns
The moisture percentage

◆ readMoistureRatio()

float sfeDevSoilMoisture::readMoistureRatio ( void  )

Reads the sensor value and returns the moisture ratio from the sensor (0 - 1.0)

Returns
The moisture ratio

◆ readMoistureValue()

uint16_t sfeDevSoilMoisture::readMoistureValue ( void  )

Reads the moisture value from the sensor.

Returns
The moisture value - a resistance reading between 0 and 1023

Member Data Documentation

◆ _theBus

sfeTkIBus* sfeDevSoilMoisture::_theBus
protected

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