Don't initialize array every loop
that's stupid Daniel, why did you do this Daniel
This commit is contained in:
parent
d92c0c0130
commit
e3279375a5
@ -23,12 +23,11 @@ void setup()
|
|||||||
lcd.print("Distance in cm");
|
lcd.print("Distance in cm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char cm[3];
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
lcd.setCursor(0,1);
|
lcd.setCursor(0,1);
|
||||||
char cm[3];
|
|
||||||
sprintf(cm, "%.3i", sonar.ping_cm());
|
sprintf(cm, "%.3i", sonar.ping_cm());
|
||||||
lcd.print(cm);
|
lcd.print(cm);
|
||||||
delay(50);
|
delay(50);
|
||||||
|
Loading…
Reference in New Issue
Block a user