Skip to content

Commit e497f5e

Browse files
committed
cleanup
1 parent 71e49e6 commit e497f5e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/sfeTk/sfeDevSoilMoisture.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*
99
*---------------------------------------------------------------------------------
1010
*/
11+
1112
#include "sfeDevSoilMoisture.h"
1213

1314
// Impl for the core driver
@@ -21,6 +22,7 @@
2122
//---------------------------------------------------------------------
2223
// Core object implementation
2324
//---------------------------------------------------------------------
25+
// start up the sensor
2426
sfeTkError_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
3740
sfeTkError_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
4650
sfeTkError_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
5661
uint16_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
8591
sfeTkError_t sfeDevSoilMoisture::changeSensorAddress(uint8_t newAddress)
8692
{
8793
if (_theBus == nullptr)

src/sfeTk/sfeDevSoilMoisture.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
*
88
*---------------------------------------------------------------------------------
99
*/
10-
// Actual implementation def of the soil moisture sensor
10+
// Actual implementation of the soil moisture sensor - this is a platform "independent" implementation
1111

1212
#pragma once
1313

1414
#include <cstdint>
15-
#include "sfeTk/sfeTkII2C.h"
15+
16+
// include the sparkfun toolkit headers
1617
#include <sfeTk/sfeToolKit.h>
1718

1819
// Default I2C address for the sensor

0 commit comments

Comments
 (0)