23#include <sfTk/sfToolkit.h>
26#include <sfTk/sfTkII2C.h>
27#include <sfTk/sfTkISPI.h>
34#define SF_SOIL_MOISTURE_DEFAULT_I2C_ADDRESS 0x28
42#define SF_SOIL_MOISTURE_MAX_VALUE 1023
69 sfTkError_t
begin(sfTkIBus *theBus =
nullptr);
95 sfTkError_t
LEDOn(
void);
Class representing the soil moisture sensor.
Definition: sfDevSoilMoisture.h:51
uint16_t readMoistureValue(void)
Reads the moisture value from the sensor.
Definition: sfDevSoilMoisture.cpp:85
sfTkError_t begin(sfTkIBus *theBus=nullptr)
Initializes communication with the soil moisture sensor.
Definition: sfDevSoilMoisture.cpp:50
uint8_t address(void)
Returns the current address of the sensor.
Definition: sfDevSoilMoisture.cpp:137
float readMoisturePercentage(void)
Reads the sensor value and returns the moisture percentage from the sensor.
Definition: sfDevSoilMoisture.cpp:109
sfDevSoilMoisture()
Definition: sfDevSoilMoisture.h:55
sfTkError_t LEDOff(void)
Turns off the on-board LED.
Definition: sfDevSoilMoisture.cpp:64
sfTkIBus * _theBus
The toolkit bus the sensor is connected to.
Definition: sfDevSoilMoisture.h:159
float readMoistureRatio(void)
Reads the sensor value and returns the moisture ratio from the sensor.
Definition: sfDevSoilMoisture.cpp:99
sfTkError_t LEDOn(void)
Turns on the on-board LED.
Definition: sfDevSoilMoisture.cpp:74
sfTkError_t setI2CAddress(uint8_t newAddress)
Changes the I2C address of the sensor.
Definition: sfDevSoilMoisture.cpp:115