encoder-control-bpm #1

Merged
dominic merged 4 commits from encoder-control-bpm into master 2026-02-19 23:23:31 -05:00
Showing only changes of commit 90693e8c2a - Show all commits

View file

@ -188,9 +188,9 @@ void checkRPot() {
Serial.println(currentPos);
if (currentPos > previousPos) {
BPM++;
handleBPMChange(1);
} else {
BPM--;
handleBPMChange(0);
}
forceScreenUpdate = 1;
@ -202,6 +202,17 @@ void checkRPot() {
}
}
void handleBPMChange(byte increase) {
if (increase == 1) {
BPM++;
} else {
BPM--;
}
period = (minute / BPM) / ppqn;
Timer1.setPeriod(period);
}
void updateEncoder() {
// The ISR should be as short and fast as possible
// Check the state of the DT pin to determine direction