From e3279375a54d7cae34804cfd9e6973988f1a8ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Thu, 14 Apr 2016 03:45:55 -0400 Subject: [PATCH] Don't initialize array every loop that's stupid Daniel, why did you do this Daniel --- School/vg1/Dataelektronikk/Ultrasonic Distance.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/School/vg1/Dataelektronikk/Ultrasonic Distance.ino b/School/vg1/Dataelektronikk/Ultrasonic Distance.ino index 43d022f..42dd601 100644 --- a/School/vg1/Dataelektronikk/Ultrasonic Distance.ino +++ b/School/vg1/Dataelektronikk/Ultrasonic Distance.ino @@ -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);