Update with leading zeroes, instead of clearing
This commit is contained in:
parent
d9cf8173ac
commit
d92c0c0130
@ -23,11 +23,13 @@ void setup()
|
||||
lcd.print("Distance in cm");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
lcd.setCursor(0,1);
|
||||
lcd.print(" ");
|
||||
lcd.setCursor(0,1);
|
||||
lcd.print(sonar.ping_cm());
|
||||
char cm[3];
|
||||
sprintf(cm, "%.3i", sonar.ping_cm());
|
||||
lcd.print(cm);
|
||||
delay(50);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user