This commit is contained in:
Fenoglio 2018-07-07 23:51:41 +02:00
commit 343b02333e

View file

@ -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 ... 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 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_state = TIMER_WAIT; // timer needs to be initialized ...
timer_state_e timer_new_state = TIMER_INIT; // timer needs to be initialized ... timer_state_e timer_new_state = TIMER_INIT; // timer needs to be initialized ...
@ -346,7 +347,7 @@ void update_screen(timer_state_e state){
char content_to_char[50]; char content_to_char[50];
char footer_to_char[50]; char footer_to_char[50];
float curr_time_test = 0.0; float curr_time_local = 0.0;
switch(state){ switch(state){
case TIMER_INIT: case TIMER_INIT:
@ -361,8 +362,8 @@ void update_screen(timer_state_e state){
break; break;
case TIMER_READY: case TIMER_READY:
header = "Ready!"; header = "Ready!";
content = "00:00"; content = "00.00 sek.";
footer = "Press Startbuton to run ..."; footer = "Waiting for start";
break; break;
case TIMER_STARTED: case TIMER_STARTED:
header = "Starting ..."; header = "Starting ...";
@ -371,9 +372,13 @@ void update_screen(timer_state_e state){
break; break;
case TIMER_RUNNING: case TIMER_RUNNING:
header = "Running ..."; header = "Running ...";
curr_time_test = (millis() - start_time)/1000.0; curr_time_local = (millis() - start_time)/1000.000;
content = curr_time_test; 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; break;
case TIMER_CANCELLED: case TIMER_CANCELLED:
header = "Cancelled!"; header = "Cancelled!";
@ -387,8 +392,9 @@ void update_screen(timer_state_e state){
break; break;
case TIMER_FAIL: case TIMER_FAIL:
header = "False start!"; header = "False start!";
content = runner_start_time - start_time; curr_time_local = (start_time - runner_start_time)/1000.000;
footer = "milliseconds too early"; content = curr_time_local;
footer = "seconds too early";
break; break;
default: default:
scr_update = false; scr_update = false;
@ -427,13 +433,15 @@ void update_screen(timer_state_e state){
display.setLetterSpacing(0); display.setLetterSpacing(0);
display.print("----------------------------"); display.print("----------------------------");
//end of the Header //end of the Header
//display.setLetterSpacing(1);
display.set2X(); display.set2X();
display.setCursor(64 - (display.strWidth(content_to_char) / 2), 3); display.setCursor(64 - (display.strWidth(content_to_char) / 2), 3);
display.print(content_to_char); display.print(content_to_char);
//end of the Content //end of the Content
display.set1X(); display.set1X();
display.setCursor(0,6); display.setCursor(0,6);
display.print("___________________________"); display.setLetterSpacing(0);
display.print("----------------------------");
display.setCursor(64 - (display.strWidth(footer_to_char) / 2), 7); display.setCursor(64 - (display.strWidth(footer_to_char) / 2), 7);
display.print(footer_to_char); display.print(footer_to_char);
} }