#include <LiquidCrystal.h>
const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
int outputValue;
void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0, 1);
lcd.print(" ");
sensorValue = analogRead(sensorPin); // print the number of seconds since reset:
lcd.setCursor(0, 1);
lcd.print(sensorValue);
delay(100);
lcd.setCursor(0, 0);
lcd.print(" ");
lcd.setCursor(0, 0);
outputValue = map(sensorValue, 0, 1023, 0, 5000);
lcd.print(outputValue);
lcd.print(" mV");
}