Go Down

Topic: LCD clear one character? (Read 3312 times) previous topic - next topic

bobbcab

I was wondering if it is possible to clear a single character on an LCD screen as I'm constantly updating the screen when i display a 2 digit number then show a single digit number the 2nd digit from the 2 digit number remains. I need to keep the rest of the information on the screen though.

Thanks in advance

RankUpGamers

Code: [Select]
lcd.setCursor(X,Y);
lcd.print(" ");


That's how I do it!
GO TECH!

Saad Khalil


Code: [Select]
lcd.setCursor(X,Y);
lcd.print(" ");


That's how I do it!

That's how we do it ;)
@ bobbcab.. If you want to clear and write something there then directly after setting cursor print that character instead of space.
Saad Khalil

bobbcab

Hahaha i didn't think of that, thanks guys

Arduino_thomas

This is not working for me  :( 




BTW: I use a Adafruit i2c 16x2 RGB
Arduino Programer :D

PaulS

Quote
This is not working for me

What isn't? Where is the code? What exactly happens?

tylernt

Code: [Select]

lcd.print(myNumber);
if(myNumber < 10)
 { lcd.print(" "); }


wwb00

#7
May 07, 2015, 01:14 am Last Edit: May 07, 2015, 01:17 am by wwb00
Code: [Select]
else if(sbTime>=100){
 lcd.setCursor(5,0);
    lcd.print("");
 lcd.setCursor(z,0);
 lcd.print(sbTime);
 lcd.setCursor(0,0);
 lcd.print(mbTime);
 lcd.setCursor(x,0);
 lcd.print(":");
 lcd.setCursor(5,0);
    lcd.print("");
 delay(time);
 sbTime--;
 pwState = wState;
 }

I put it to clear a certain part of the lcd where the millisecond counter is. It never cleared. When i replaced the lcd.print(""); with lcd.print("."); it displayed an period where I wanted the nothing. Help?!

aarg

Code: [Select]
else if(sbTime>=100){
 lcd.setCursor(5,0);
    lcd.print("");
 lcd.setCursor(z,0);
 lcd.print(sbTime);
 lcd.setCursor(0,0);
 lcd.print(mbTime);
 lcd.setCursor(x,0);
 lcd.print(":");
 lcd.setCursor(5,0);
    lcd.print("");
 delay(time);
 sbTime--;
 pwState = wState;
 }

I put it to clear a certain part of the lcd where the millisecond counter is. It never cleared. When i replaced the lcd.print(""); with lcd.print("."); it displayed an period where I wanted the nothing.
Nothing, by definition, occupies no space. Space, by definition, does.

vaj4088

In other words, try using
Code: [Select]
lcd.print(" ");

(NOTICE THE SPACE BETWEEN THE QUOTES)

instead of

Code: [Select]
lcd.print("");

wwb00


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy