#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
Serial.begin(9600);
pinMode(A0, INPUT);
lcd.init();
lcd.backlight();
}
void loop()
{
int16_t i = analogRead(A0);
String msg = i < 300 ? "WET" : i > 400 ? "DRY" : "OK";
lcd.clear();
lcd.print("Soil: ");
lcd.print(msg);
delay(500);
}