#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 20);
void setup() {
Serial.begin(9600);
lcd.init();
// put your setup code here, to run once:
}
void loop() {
int sensorValue = analogRead(A0);
//convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5)
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(sensorValue);
Serial.println(voltage);
delay(500);
lcd.setCursor(0,0);
lcd.print("sensorValue");
lcd.setCursor(0,1);
lcd.print(voltage);
// put your main code here, to run repeatedly:
}