Input LCD 16x2 name and surname

Hello everyone. I need to make an input from the console to the first line of my name and to the second last name in the LCD 16x2.
I can't figure out how to do it?

#include <LiquidCrystal.h>

LiquidCrystal lcd(5, 6, 7, 8, 9, 10);

void setup()
  lcd.begin(16, 2);
  Serial.begin(9600);
  Serial.println("Please input only 16 characters"); 
}

void loop() {
  
  
  if (Serial.available()) {
   
   
    delay(600);
   
    while (Serial.available() > 0) {
   
      lcd.write(Serial.read());
      
      
  
    
  }
  
}>

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

1 Like

Split it into two parts: reading the Serial text and writing to the display.

This is the reference for the Serial library: https://www.arduino.cc/en/reference/serial.
Try a few examples, read what the functions do, and see how far you get.

Does the LCD display work ?
Did you know that you can try the Serial and the LCD display in Wokwi simulation ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.