From 343422c1b5170a5b58d38305322069aa1ddb0e2b Mon Sep 17 00:00:00 2001 From: --global <--global> Date: Fri, 12 May 2023 21:13:24 +0300 Subject: [PATCH] fixed bug where play button was not working after changing modes --- software/GToE/GToE.ino | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/software/GToE/GToE.ino b/software/GToE/GToE.ino index 63d70ab..1961420 100644 --- a/software/GToE/GToE.ino +++ b/software/GToE/GToE.ino @@ -293,6 +293,8 @@ void resetClocks() { channelPulseCount[i] = 0; digitalWrite(outsPins[i], LOW); //to avoid stuck leds } + pulseCount = 0; + tickCount = 0; } void saveState() { @@ -337,6 +339,10 @@ void checkInputs() { masterClockMode++; } else { masterClockMode = 0; + isPlaying = false; // These don't seem to help with play btn not working after switching modes + resetClocks(); // so maybe remove them + calculateBPMTiming(); // + calculateCycles(); // } updateScreen(); } @@ -391,7 +397,7 @@ void checkInputs() { } //play button - if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed) { + if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed && masterClockMode == 0) { resetClocks(); isPlaying = !isPlaying; playBtnPushed = true;