19 lines
315 B
Arduino
19 lines
315 B
Arduino
/*
|
|
* Soil moisture sensor on Wemos D1
|
|
*/
|
|
|
|
// the analog input on the Wemos D1 accepts up to 3.3V
|
|
const int analogPin = A2;
|
|
int val = 0;
|
|
|
|
void setup() {
|
|
Serial.begin(9600);
|
|
Serial.println("Starting moisture measurement");
|
|
}
|
|
|
|
void loop() {
|
|
val = analogRead(analogPin);
|
|
Serial.println(val);
|
|
delay(1000);
|
|
}
|