Don't initialize array every loop

that's stupid Daniel, why did you do this Daniel
This commit is contained in:
Daniel Løvbrøtte Olsen 2016-04-14 03:45:55 -04:00
parent d92c0c0130
commit e3279375a5

View File

@ -23,12 +23,11 @@ void setup()
lcd.print("Distance in cm");
}
char cm[3];
void loop()
{
lcd.setCursor(0,1);
char cm[3];
sprintf(cm, "%.3i", sonar.ping_cm());
lcd.print(cm);
delay(50);