#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
void setup() {
lcd.init(); // initialize the lcd
lcd.backlight();
Serial.begin(115200);
pinMode(4, INPUT);
}
void loop() {
int16_t j = analogRead(4);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("CO2: ");
lcd.print(analogRead(4));
lcd.setCursor(9, 0);
lcd.print("ppm");
delay(500); // print message at (0, 0)
lcd.setCursor(5, 1); // move cursor to (2, 1)
lcd.print("EC Dept"); // print message at (2, 1)
delay(2000); // display the above for two seconds
Serial.print("Analog: ");
Serial.println(analogRead(4));
delay(100);
}