#include int sensorPin = A0; // select the input pin for the potentiometer int sensorValue = 0; // variable to store the value coming from the sensor LiquidCrystal lcd(2, 3, 10, 11, 12, 13);// Pinout, RS=2, E=3, DB4=10, DB5=11, DB6=12, DB7=13 int numRows = 2; // Number of rows of the LCD int numCols = 16; // Number of Columns of the LCD void setup() // We write the initial configuration of our program. { lcd.begin(numRows, numCols); // Allocates or initializes the number of rows and columns of the LCD. lcd.clear(); // Clean the LCD screen lcd.setCursor(0,0); // Place the cursor at column 0, row 0. lcd.print("* Arduino *"); // Write on the screen that is indicated between quotes. lcd.setCursor(0,1); // Place the cursor at column 0, row 1. lcd.print("* Professor *"); // Write on the screen that is indicated between quotes. delay(2000); // Wait 2 seconds. lcd.clear(); // Clean the LCD screen lcd.setCursor(0,0); // Place the cursor at column 0, row 0. lcd.print("* LCD Screen *"); // Write on the screen that is indicated between quotes. lcd.setCursor(0,1); // Place the cursor at column 0, row 1. lcd.print("* ADC Exercise *"); // Write on the screen that is indicated between quotes. delay(2000); // Wait 2 seconds. lcd.clear(); // Clean the LCD screen } void loop() { // Read the value from the sensor: sensorValue = analogRead(sensorPin); // Reads the voltage on the corresponding pin and converts it into a digital value. // which is stored in the variable "sensorValue". lcd.setCursor(0,0); // Place the cursor at column 0, row 0. lcd.print(" A0 pin value: "); // Write on the screen that is indicated between quotes. lcd.setCursor(7,1); // Place the cursor at column 7, row 1. lcd.print(sensorValue); // It is written on the screen indicated between quotes. delay(100); // Wait 50 milliseconds. lcd.setCursor(7,1); // Place the cursor at column 7, row 1. lcd.print(" "); // Clear LCD screen on the (7,1) position. }