How does one update the display in a LCD (16,2) in Arduino, say for example I want to display an additional characters or (sequential characters) characters and the screen is full?

  • That depends on what you want to do to make space. Scroll up/down a line at a tone? Scroll left/right a character at a time? Erase the screen and start in a fresh corner? – jose can u c Jan 29 '19 at 12:14
  • @josecanuc I want to erase the character and input others...this is how am doing it,,,I have the LCD displaying the temperature and indicating the state of a PIR sensor as "HIGH" or "LOW" _now I have a LDR that senses the amount of light in my room, I want to display another character in the same LCD when the LDR Shows low values,but note that I need this to be displayed when the ldr value is low. – user52889 Jan 29 '19 at 15:30
  • Change HIGH and LOW to just H and L will give you 2 extra characters. Or even better; only show "PIR" when the PIR is triggered, and nothing when it isn't. – Gerben Jan 29 '19 at 16:21

You can erase the entire screen with clear().

You can erase a specific location by calling setCursor() to move the cursor to the position to blank and then print a space character, like print(" ") (or multiple spaces, depending on how many characters you need to clear out.

The LiquidCrystal library is documented on the Arduino website at https://www.arduino.cc/en/Reference/LiquidCrystal

  • Printing an empty space worked but the part displaying temperature change is not being erased,what could be the problem – user52889 Jan 29 '19 at 15:54
  • 2
    No one could say unless you add your complete code to the question by editing it. You have to over-write a space on every position that you want to clear out, and be sure that some other part of your code isn't writing it back. – jose can u c Jan 29 '19 at 16:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.