#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
Wire.begin(23, 22);
Serial.begin(9600);
lcd.init();
lcd.backlight();
}
void loop() {
int16_t i = analogRead(A0); // Read from analog pin A0
String msg = (i < 1680) ? "WET" : (i > 3620) ? "DRY" : "OK"; // Adjusted threshold values
lcd.clear();
lcd.print("Soil: ");
lcd.print(msg);
delay(500);
}