From ec9e9f09ee2ae71c1f753c7526b02cf1f0cf6d96 Mon Sep 17 00:00:00 2001 From: Fisch Date: Fri, 12 Jul 2024 21:44:40 +0200 Subject: [PATCH] add start button debug display output --- controller_teensy/include/display.h | 3 +++ controller_teensy/src/main.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/controller_teensy/include/display.h b/controller_teensy/include/display.h index d9aaf9b..65a0246 100644 --- a/controller_teensy/include/display.h +++ b/controller_teensy/include/display.h @@ -353,6 +353,9 @@ void display_standingDisarmedDisplay(ESCSerialComm& escFront, ESCSerialComm& esc if (control_buttonB){ display.print(" B"); } + if (button_start_state){ + display.print(" S"); + } } diff --git a/controller_teensy/src/main.cpp b/controller_teensy/src/main.cpp index b5f9f39..5827343 100644 --- a/controller_teensy/src/main.cpp +++ b/controller_teensy/src/main.cpp @@ -610,6 +610,7 @@ void readButtons() { static bool button_start_wait_release_flag=false; bool last_button_start_state=button_start_state; + if (loopmillis > button_start_lastchange+DEBOUNCE_TIME) { //wait some time after last change if (digitalRead(PIN_PWRBUTTON) && !button_start_state) { //start engine button pressed and was not pressed before button_start_state=true; //pressed