Added pattern clearing on long shift press

This commit is contained in:
2023-08-03 21:02:19 +03:00
parent ede342fb1f
commit d8398eb986
2 changed files with 28 additions and 16 deletions

View File

@ -240,6 +240,7 @@ void checkInputs() {
//shift button
if (!digitalRead(SHIFT_BTN_PIN) && !shiftBtnPushed) {
shiftBtnPushed = true;
shiftPressedTime = millis();
if (isRecording) { //Live triggering
digitalWrite(outsPins[displayTab - 1], HIGH);
}
@ -256,6 +257,13 @@ void checkInputs() {
updateScreen();
} else if (digitalRead(SHIFT_BTN_PIN) && shiftBtnPushed) {
shiftBtnPushed = false;
shiftReleasedTime = millis();
if (shiftReleasedTime - shiftPressedTime > 500 && shiftReleasedTime - shiftPressedTime < 2000 && isRecording) {
for (byte i = 0; i < 16; i++) {
patternToEdit[i] = 0;
}
}
saveState();
updateScreen();
}