![Seeed Grove Moisture Sensor Скачать руководство пользователя страница 11](http://html.mh-extra.com/html/seeed/grove-moisture-sensor/grove-moisture-sensor_user-manual_1232894011.webp)
8
/*
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 39 /* 4-digital display clock pin */
#define DIO 38 /* 4-digiral display data pin */
#define BLINK_LED RED_LED /* blink led */
#define MOISTURE_PIN 24 /* pin of moisture sensor */
#define THRESHOLD_VALUE 300 /* threshold for watering the flowers */