//YWROBOT //Compatible with the Arduino IDE 1.0 //Library version:1.1 #include #include LiquidCrystal_I2C lcd(0x27, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display int sensorPin = A0; int sensorValue = 0; void setup() { Serial.begin(9600); lcd.init(); // initialize the lcd lcd.init(); lcd.backlight(); lcd.setCursor(3, 0); lcd.print("Starting"); delay(1500); } void loop() { sensorValue = analogRead(sensorPin); Serial.println(sensorValue); if (sensorValue > 300) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Drink water"); } else if(sensorValue < 300) { lcd.clear(); lcd.setCursor(0, 0); lcd.print("Keep going"); } }