88 *
99 *---------------------------------------------------------------------------------
1010 */
11+
1112#include " sfeDevSoilMoisture.h"
1213
1314// Impl for the core driver
2122// ---------------------------------------------------------------------
2223// Core object implementation
2324// ---------------------------------------------------------------------
25+ // start up the sensor
2426sfeTkError_t sfeDevSoilMoisture::begin (sfeTkIBus *theBus)
2527{
2628 // Nullptr check
@@ -34,6 +36,7 @@ sfeTkError_t sfeDevSoilMoisture::begin(sfeTkIBus *theBus)
3436}
3537
3638// ----------------------------------------------------------------------------------------
39+ // LED off command
3740sfeTkError_t sfeDevSoilMoisture::LEDOff (void )
3841{
3942 if (_theBus == nullptr )
@@ -43,6 +46,7 @@ sfeTkError_t sfeDevSoilMoisture::LEDOff(void)
4346 return _theBus->writeByte (kCommandLEDOff );
4447}
4548// ----------------------------------------------------------------------------------------
49+ // LED on command
4650sfeTkError_t sfeDevSoilMoisture::LEDOn (void )
4751{
4852 if (_theBus == nullptr )
@@ -53,6 +57,7 @@ sfeTkError_t sfeDevSoilMoisture::LEDOn(void)
5357}
5458
5559// ----------------------------------------------------------------------------------------
60+ // Read the moisture value from the sensor - returns a resistance reading between 0 and 1023
5661uint16_t sfeDevSoilMoisture::readMoistureValue (void )
5762{
5863 if (_theBus == nullptr )
@@ -82,6 +87,7 @@ float sfeDevSoilMoisture::readMoisturePercentage(void)
8287 return readMoistureRatio () * 100.0 ;
8388}
8489// ----------------------------------------------------------------------------------------
90+ // Change the I2C address of the sensor
8591sfeTkError_t sfeDevSoilMoisture::changeSensorAddress (uint8_t newAddress)
8692{
8793 if (_theBus == nullptr )
0 commit comments