encoder constrols screen
This commit is contained in:
parent
e317595cdd
commit
90693e8c2a
1 changed files with 13 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue