// include the library code: #include // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 11, d7 = 12; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // initialize the serial communications: Serial.begin(9600); pinMode(9, OUTPUT); analogWrite(9, 105); //change 105 to adjust contrast // set up the LCD's number of columns and rows: lcd.begin(16, 2); } void loop() { // when characters arrive over the serial port... if (Serial.available()) { // wait a bit for the entire message to arrive delay(100); // clear the screen lcd.clear(); int i = 0; // read all the available characters while (Serial.available() > 0) { i++; if (i==17) { lcd.setCursor(0, 1); } // display each character to the LCD lcd.write(Serial.read()); } delay (5000); // clear the screen lcd.clear(); } }