-
Notifications
You must be signed in to change notification settings - Fork 0
Soil Moisture
Josh Perriman edited this page Aug 22, 2018
·
1 revision
Used to take a reading from the soil moisture sensor. On the By default the Drive pin is on D10 and the sense pin is on A4. For an example of how to use all the functions in this library see the example included with the library.
void init_AC(uint8_t outPin);
Setup the timers and comparators used in the soil moisture reading
- outPin = The pin that is used as the drive pin for the moisture sensor (Pin 10 on the micronode)
uint32_t takeSoilReading(uint16_t counts);
Used to actually take a sensor reading. Will return the average time to charge or discharge the capacitor.
- counts = The amount of charges/discharges to take to generate an average time per charge.
void disableAC();
Used to disable the timers and analog comparator used for this sensor. This will save power. To take another reading init_AC will need to be called first.