Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set the volume always. #28

Merged
merged 1 commit into from
Oct 20, 2018
Merged

Set the volume always. #28

merged 1 commit into from
Oct 20, 2018

Conversation

wmarkow
Copy link

@wmarkow wmarkow commented Oct 19, 2018

This is a proposed solution for #26. The setVolume() method sets the volume always but still caches the saved value.

I wanted to get rid that curvol cache value, the returned value could be read from the chip directly, but it needs to be converted back (by a map function for example) to a range from 0 to 100. There was a side effect, when I did a small test like:

player.setVolume(70);
uint8_t readBack = player.getVolume();

then the readBack variable was set to 69. Probably this is an effect of rounding when using map method. I gave up with this solution, so in my PR the curvol is not totaly removed.

@baldram baldram merged commit 0d1aa59 into baldram:master Oct 20, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants