Skip to content

Commit

Permalink
Fix, minor but useful code beauty.
Browse files Browse the repository at this point in the history
  • Loading branch information
poetaster committed Jul 4, 2024
1 parent c97a837 commit 28fc9bf
Show file tree
Hide file tree
Showing 3 changed files with 3,240 additions and 3,239 deletions.
11 changes: 6 additions & 5 deletions firmware/rampart3-bytebeats/rampart3-bytebeats.ino
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ uint16_t readcv(uint8_t potnum) {
int input;
switch (potnum) { // map potnum to pin
case 0:
input = 3;
input = A3;
break;
case 1:
input = 6;
input = A6;
break;
case 2:
input = 7;
input = A7;
break;
}
// note that Pikocore pots are wired "backwards" - max voltage is full ccw
Expand All @@ -339,13 +339,14 @@ uint16_t readcv(uint8_t potnum) {

if (abs(lastpotvalue[potnum] - val) > MIN_COUNTS ) {
lastpotvalue[potnum] = val; // even if pot is unlocked, make sure pot has moved at least MIN_COUNT counts so values don't jump around
if(debug) Serial.print("readcv: ");
if(debug) Serial.println(val);
} else {
val = lastpotvalue[potnum];
}

potvalue[potnum] = val; // pot is unlocked so save the reading
//if(debug) Serial.print("readcv: ");
//if(debug) Serial.println(val);

return val;
}

Expand Down
Loading

0 comments on commit 28fc9bf

Please sign in to comment.