0) // if we get a valid byte, read analog ins: { comdata = ""; while (Serial.available() > 0) { comdata += char(Serial.read()); delay(2); } lcd.clear(); } lcd.clear(); // start with a blank screen lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row) lcd.print(comdata); // change text to whatever you like. keep it clean! delay(800); }"> 0) // if we get a valid byte, read analog ins: { comdata = ""; while (Serial.available() > 0) { comdata += char(Serial.read()); delay(2); } lcd.clear(); } lcd.clear(); // start with a blank screen lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row) lcd.print(comdata); // change text to whatever you like. keep it clean! delay(800); }"> 0) // if we get a valid byte, read analog ins: { comdata = ""; while (Serial.available() > 0) { comdata += char(Serial.read()); delay(2); } lcd.clear(); } lcd.clear(); // start with a blank screen lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row) lcd.print(comdata); // change text to whatever you like. keep it clean! delay(800); }">
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 13, 5, 4, 3, 2);
String comdata = "";

void setup() {
  lcd.begin(16,2);  // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  Serial.begin(9600);  // start serial port at 9600 bps:
 
}
void loop() {
    //read string from serial monitor
  if(Serial.available()>0)  // if we get a valid byte, read analog ins:
  {  
    comdata = "";
    while (Serial.available() > 0)  
    {        
      comdata += char(Serial.read());
      delay(2);
    }
    lcd.clear();
  }
  
  lcd.clear();  // start with a blank screen
  lcd.setCursor(0,0);  // set cursor to column 0, row 0 (the first row)
  lcd.print(comdata); // change text to whatever you like. keep it clean!
  delay(800);

}