#include int buttonPinA0 = A0; // select the input pin A0 for the buttons int buttonValueA0 = 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: buttonValueA0 = analogRead(buttonPinA0); // Reads the voltage on the corresponding pin and converts it into a digital value. // which is stored in the variable "buttonValueA0". 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(buttonValueA0); // It is written on the screen indicated between quotes. delay(500); // Wait 0.5 seconds. lcd.setCursor(8,1); // Place the cursor at column 8, row 1. lcd.print(" "); // Clear LCD screen begining on the (8,1) position. }