#include int sensorPinA0 = A0; // select the input pin A0 for the potentiometer int sensorValueA0 = 0; // variable to store the value coming from the sensor, Pin A0 LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Pinout, RS=8, E=9, DB4=4, DB5=5, DB6=6, DB7=7 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 Shield *"); // Write on the screen that is indicated between quotes. lcd.setCursor(0,1); // Place the cursor at column 0, row 1. lcd.print("* and KeyPad *"); // Write on the screen that is indicated between quotes. delay(3000); // Wait 3 seconds. lcd.clear(); // Clean the LCD screen } void loop() { // Read the value from the sensor: sensorValueA0 = analogRead(sensorPinA0); // Reads the voltage on the corresponding pin and converts it into a digital value. // which is stored in the variable "sensorValueA0". lcd.setCursor(3,0); // Place the cursor at column 3, row 0. lcd.print("A0 value:"); // Write on the screen that is indicated between quotes. lcd.setCursor(4,1); // Place the cursor at column 4, row 1. lcd.print("A0: "); // Write on the screen that is indicated between quotes. lcd.setCursor(8,1); // Place the cursor at column 8, row 1. lcd.print(sensorValueA0); // It is written on the screen indicated between quotes. delay(1000); // Wait 1 second. lcd.setCursor(8,1); // Place the cursor at column 8, row 1. lcd.print(" "); // Clear LCD screen begining on the (3,1) position. }