/*
Moisture-Sensor
The following sketch demonstrates a simple application of sensing
the moisture of the soil. You can know whether a plant needs water
or not by observing the results that the sensor outputs.
The circuit:
* Moisture-Sensor attached to pin 24 (J6 plug on Grove Base BoosterPack)
* one side pin (either one) to ground
* the other side pin to +VCC
* LED anode (long leg) attached to RED_LED
* LED cathode (short leg) attached to ground
* Note:
This example code is in the public domain.
http://seeedstudio.com/wiki/Grove_-_Moisture_Sensor
*/
#include "TM1637.h"
/* Macro Define */
#define CLK
#define DIO
#define BLINK_LED
#define MOISTURE_PIN
#define THRESHOLD_VALUE
39
/* 4-digital display clock pin */
38
/* 4-digiral display data pin */
RED_LED
/* blink led */
24
/* pin of moisture sensor */
300
/* threshold for watering the flowers */
8
Need help?
Do you have a question about the Grove Moisture Sensor and is the answer not in the manual?
Questions and answers