#include int sensorPinA0 = A0; // select the input pin A0 for the potentiometer int sensorPinA1 = A1; // select the input pin A1 for the potentiometer int sensorValueA0 = 0; // variable to store the value coming from the sensor, Pin A0 int sensorValueA1 = 0; // variable to store the value coming from the sensor, Pin A1 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: sensorValueA0 = analogRead(sensorPinA0); // Reads the voltage on the corresponding pin and converts it into a digital value. // which is stored in the variable "sensorValueA0". sensorValueA1 = analogRead(sensorPinA1); // Reads the voltage on the corresponding pin and converts it into a digital value. // which is stored in the variable "sensorValueA1". lcd.setCursor(0,0); // Place the cursor at column 0, row 0. lcd.print(" A0 & A1 value: "); // Write on the screen that is indicated between quotes. lcd.setCursor(0,1); // Place the cursor at column 0, 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("A1: "); // Write on the screen that is indicated between quotes. lcd.setCursor(3,1); // Place the cursor at column 3, row 1. lcd.print(sensorValueA0); // It is written on the screen indicated between quotes. lcd.setCursor(11,1); // Place the cursor at column 11, row 1. lcd.print(sensorValueA1); // It is written on the screen indicated between quotes. delay(1000); // Wait 1 second. lcd.setCursor(3,1); // Place the cursor at column 3, row 1. lcd.print(" "); // Clear LCD screen begining on the (3,1) position. lcd.setCursor(11,1); // Place the cursor at column 11, row 1. lcd.print(" "); // Clear LCD screen beginig on the (11,1) position. }