How to erase these 2 symbols on LCD2004A?

I got 2 bit pattern symbols at the end of the second line after lcd.print(" %");, When I run lcd.print(" \n"); after lcd.print(" %"), it wouldn't disappeared, and would attach another 3 this symbols after a space, why and how to remove these?

How could we know? No sketch!

Oh nevermind then :upside_down_face:

use print instead of println.
print (" \n") will also print this line - so why do you send \n when you dont need them?

P.S.: it seems to be LCD2004 ... 20 characters, 4 lines. You can correct your thread header.

1 Like

It is not clear from your description but it seems that you are trying to print a '\n' (newline) character which will not work on an LCD

Instead, use the setCursor() function to position the cursor before printing the data

If you still have a problem then please post your full sketch, using code tags when you do

Hi, @MianQi

You need to look at some Examples that come with the library you are using to see the instruction set they use.

A copy of your complete code would help.

Tom.... :smiley: :+1: :coffee: :australia:

here is my code:

        lcd.setCursor(0, 0);
        lcd.print("Temperature: ");
        lcd.print(temperature);
        lcd.print("\337C");
        //lcd.print(" °C");
        lcd.setCursor(0, 1);
        lcd.print("Humidity: ");
        lcd.print(humidity);
        lcd.println(" %");
        lcd.setCursor(0, 2);
        lcd.blink();

And the probable solution is in posts #3 and #4. Did you try it?

1 Like

In order to "remove" them, you need to overwrite them with a SPACE character. You can avoid this by making the temperature and humidity values a fixed width so your degC and % symbols don't need to move. For example if your temperature changed from 10 to 9, then when you display the 9, display a space before it.

Once you have your display text setup, you can then just setCursor to the value position and overwrite it rather than displaying the associated text as well.

 lcd.println(" %");

Don't use println() as the LCD cannot interpret the Carriage Return and/or Linefeed that it outputs. Use print() instead and position the cursor using setCursor()

1 Like