From 65e3d81b8806e96e1bc38b5256c79a8110ef76c4 Mon Sep 17 00:00:00 2001 From: CodeCrafter912 Date: Sat, 7 Jul 2018 23:25:46 +0200 Subject: [PATCH 1/2] improved display --- speedclock.ino | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/speedclock.ino b/speedclock.ino index 6a8886d..7bc16d9 100644 --- a/speedclock.ino +++ b/speedclock.ino @@ -346,7 +346,7 @@ void update_screen(timer_state_e state){ char content_to_char[50]; char footer_to_char[50]; - float curr_time_test = 0.0; + float curr_time_local = 0.0; switch(state){ case TIMER_INIT: @@ -362,7 +362,7 @@ void update_screen(timer_state_e state){ case TIMER_READY: header = "Ready!"; content = "00:00"; - footer = "Press Startbuton to run ..."; + footer = "Waiting for start"; break; case TIMER_STARTED: header = "Starting ..."; @@ -371,8 +371,8 @@ void update_screen(timer_state_e state){ break; case TIMER_RUNNING: header = "Running ..."; - curr_time_test = (millis() - start_time)/1000.0; - content = curr_time_test; + curr_time_local = (millis() - start_time)/1000.000; + content = curr_time_local; footer = "sek."; break; case TIMER_CANCELLED: @@ -387,8 +387,9 @@ void update_screen(timer_state_e state){ break; case TIMER_FAIL: header = "False start!"; - content = runner_start_time - start_time; - footer = "milliseconds too early"; + curr_time_local = (start_time - runner_start_time)/1000.000; + content = curr_time_local; + footer = "seconds too early"; break; default: scr_update = false; From 5bec4fa9da6fae697c2f101435aa516cab6a6539 Mon Sep 17 00:00:00 2001 From: CodeCrafter912 Date: Sat, 7 Jul 2018 23:50:28 +0200 Subject: [PATCH 2/2] improved display --- speedclock.ino | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/speedclock.ino b/speedclock.ino index 7bc16d9..5422137 100644 --- a/speedclock.ino +++ b/speedclock.ino @@ -31,6 +31,7 @@ signed long runner_run_time = 0; // this is the time the runner rea unsigned long run_time = 0; // if the timer is running this is that start time ... boolean warn_during_run = false; // will be set to true if there is a warning during the run - usually an offset sync error + timer_state_e timer_state = TIMER_WAIT; // timer needs to be initialized ... timer_state_e timer_new_state = TIMER_INIT; // timer needs to be initialized ... @@ -361,7 +362,7 @@ void update_screen(timer_state_e state){ break; case TIMER_READY: header = "Ready!"; - content = "00:00"; + content = "00.00 sek."; footer = "Waiting for start"; break; case TIMER_STARTED: @@ -373,7 +374,11 @@ void update_screen(timer_state_e state){ header = "Running ..."; curr_time_local = (millis() - start_time)/1000.000; content = curr_time_local; - footer = "sek."; + content += " sek."; + curr_time_local = (runner_start_time - start_time)/1000.000; + footer = "started "; + footer += curr_time_local; + footer += " too late"; break; case TIMER_CANCELLED: header = "Cancelled!"; @@ -428,13 +433,15 @@ void update_screen(timer_state_e state){ display.setLetterSpacing(0); display.print("----------------------------"); //end of the Header + //display.setLetterSpacing(1); display.set2X(); display.setCursor(64 - (display.strWidth(content_to_char) / 2), 3); display.print(content_to_char); //end of the Content display.set1X(); display.setCursor(0,6); - display.print("___________________________"); + display.setLetterSpacing(0); + display.print("----------------------------"); display.setCursor(64 - (display.strWidth(footer_to_char) / 2), 7); display.print(footer_to_char); }