Simple Sensors Arduino library 1.0.0
A library for all the Simple Sensors by Soldered Electronics, regular and easyC versions.
Loading...
Searching...
No Matches
simpleSoilSensor Class Reference

#include <Simple-Soil-Sensor-SOLDERED.h>

Inherits simpleSensor.

Public Member Functions

 simpleSoilSensor ()
 
 simpleSoilSensor (uint8_t _analogPin, uint8_t _digitalPin)
 
bool isMoist ()
 Get the reading of the sensor if the soil is moist or not according to the set threshold.
 
- Public Member Functions inherited from simpleSensor
 simpleSensor ()
 easyC constructor for the Simple Sensors.
 
 simpleSensor (uint8_t _analogPin, uint8_t _digitalPin)
 Native constructor for the Simple Sensors.
 
uint16_t getRawReading ()
 Get the raw reading of the sensor.
 
float getResistance ()
 Calculate resistance which the sensor is measuring.
 
float getValue ()
 Get the value of the sensor as a percentage.
 
void setRawThreshold (uint16_t _thresh)
 Set the raw value of the threshold. Only for easyC.
 
uint16_t getRawThreshold ()
 Get the raw value of the threshold.
 
void setThreshold (float _thresh)
 Set the threshold as a percentage. Only for easyC.
 
float getThreshold ()
 Get the percentage value of the threshold, only for easyC.
 
void invertLED (bool _invert)
 Invert the LED on the breakout board.
 
void calibrate (float _highPercentage)
 Calibrate the high percentage value of the reading.
 
uint8_t getDigitalPin ()
 Get the location of D0 on the native board.
 
- Public Member Functions inherited from EasyC
 EasyC ()
 Main constructor for easyC version.
 
void begin ()
 Initializes sensors on native or easyC on default address.
 
void begin (uint8_t _address)
 Initializes sensors on supplied i2c address.
 
int sendAddress (char regAddr)
 Private function to send a single byte to sensor.
 
int readData (char a[], int n)
 Private function to read n bytes over i2c.
 
int readRegister (char regAddr, char a[], size_t n)
 Private function to send over i2c and then read n bytes.
 
int sendData (const uint8_t *a, int n)
 Private function to write n bytes over i2c.
 

Additional Inherited Members

- Public Attributes inherited from EasyC
int native = 0
 
bool beginDone = 0
 
int err
 
char address
 
const char defaultAddress = 0x30
 
- Protected Member Functions inherited from simpleSensor
void initializeNative ()
 Overloaded function for virtual in base class to initialize sensor specific.
 

Detailed Description

This class inherits the main simpleSensor class

Constructor & Destructor Documentation

◆ simpleSoilSensor() [1/2]

simpleSoilSensor::simpleSoilSensor ( )
inline

◆ simpleSoilSensor() [2/2]

simpleSoilSensor::simpleSoilSensor ( uint8_t _analogPin,
uint8_t _digitalPin )
inline

Member Function Documentation

◆ isMoist()

bool simpleSoilSensor::isMoist ( )

Get the reading of the sensor if the soil is moist or not according to the set threshold.

Returns
bool, True if it's moist, False if not

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