From 6484f6dc71cd3289dda949d95a6b79a130dd10e2 Mon Sep 17 00:00:00 2001 From: Stefan Heinrichsen Date: Sat, 29 Dec 2018 19:24:12 +0100 Subject: [PATCH] fixed delay issue due impossile reading at the end of a animation file; removed many Serial.print lines --- UNHB-Esel/FileHandling.ino | 6 ++---- UNHB-Esel/UNHB-Esel.ino | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/UNHB-Esel/FileHandling.ino b/UNHB-Esel/FileHandling.ino index 0f73027..1c14445 100644 --- a/UNHB-Esel/FileHandling.ino +++ b/UNHB-Esel/FileHandling.ino @@ -8,14 +8,11 @@ int getFileFrames(char* file) { Serial.println("Cannot open file!"); return -1; } else { - Serial.println("Reading file and trying to find frame counter..."); while(f.available() && n<0) { line = f.readStringUntil('\n'); n = line.lastIndexOf("FRAME_COUNT"); } - Serial.println("Frame Counter found at this line:"); - Serial.println(line); String strFrameNumber = line.substring(n+12); result = strFrameNumber.toInt(); } @@ -56,7 +53,8 @@ void playFile(char* file, int framespeed) { } strip.Show(); delay(framespeed); - line = f.readStringUntil('\n'); line = f.readStringUntil('\n'); + + if(frame