Skip to content

Commit

Permalink
Issue_117: Support potentiometer for setting the volume
Browse files Browse the repository at this point in the history
  • Loading branch information
boerge1 committed Oct 13, 2023
1 parent c611bbb commit 60acc9b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/poti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ Poti::Poti(const Settings& settings, Mp3& mp3)

commandRaw Poti::getCommandRaw() {
const uint8_t volume = map( analogRead(potiPin), 0, maxLevel, settings.minVolume, settings.maxVolume);
LOG(button_log, s_debug, F("poti volume: "), volume);

if (volume != mp3.getVolume()) {
LOG(button_log, s_debug, F("start setVolume"));
LOG(button_log, s_debug, F("poti volume: "), volume);
mp3.setVolume(volume);
LOG(button_log, s_debug, F("finished setVolume"));
}

return commandRaw::none;
Expand Down

0 comments on commit 60acc9b

Please sign in to comment.