FC-28 Soil Humidity/Moisture Sensor class.
More...
#include </home/travis/build/forGGe/theCore/dev/sensor/fc28/export/dev/sensor/fc28.hpp>
template<typename PowerPin = ecl::empty_gpio>
class ecl::sensor::fc28< PowerPin >
FC-28 Soil Humidity/Moisture Sensor class.
- Template Parameters
-
PowerPin | Power GPIO connected to the power input of FC-28. |
According to what can be found in Web, power pin must be capable to supply around as 20-30 ma at 5V. In practice, 3V is enough too. If sensor is connected directly to the power output pin on the board and there is no way to control it (usually it is always "on") then ecl::empty_gpio can be used in a place of PowerPin.
- ADC control
- ADC must be controlled outside of this sensor. This is required to avoid any race conditions when multiple sensors access the same ADC. To convert ADC sample to the moisture value, use get_moisture() routine.
◆ power_on()
template<typename PowerPin >
◆ power_off()
template<typename PowerPin >
◆ get_moisture()
template<typename PowerPin >
template<typename St , typename Rt >
Gets moisture value based on previously converted ADC sample.
- Template Parameters
-
St | Sample type. |
Rt | Resolution type. |
- Parameters
-
[in] | sample | ADC sample. |
[in] | resolution | ADC resolution, in bits. |
[out] | moisture | Resulting moisture. Valid value can be read only if operation is successfull. |
- Returns
- Status of operation. err::ok indicates successfull operation.
The documentation for this class was generated from the following file: