Skip to content

Commit

Permalink
fix max value
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkberg committed Jun 2, 2017
1 parent bb313ed commit 8198123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/CalliopeTestBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void testBoard() {
int mic = uBit.io.P21.getAnalogValue();
// ((value - fromLow) * (toHigh - toLow)) / (fromHigh - fromLow) + toLow
if (mic > 512) {
const int gauge = ((log2(mic - 511) * 5) / 9);
const int gauge = ((log2(mic - 511) * 4) / 9);

for (int i = 0; i <= 4; i++) {
uBit.display.image.setPixelValue(4, 4 - i, i > gauge ? 0 : 255);
Expand Down

0 comments on commit 8198123

Please sign in to comment.