HI dear wolle
thanks for this great lib
i found a little bug in this lib : VS1053::getVolume() returns wrong value ins it needs a little correction in VS1053::setVolume
this is your code:
void VS1053::setVolume(uint8_t vol)
{
uint16_t value; // Value to send to SCI_VOL
if(vol > 21) vol=21;
vol=volumetable[vol];
if(vol != curvol)
{
curvol=vol; // Save for later use
value=map(vol, 0, 100, 0xF8, 0x00); // 0..100% to one channel
value=(value << 8) | value;
write_register(SCI_VOL, value); // Volume left and right
}
}
for correction please edit:
void VS1053::setVolume(uint8_t vol)
{
uint16_t value; // Value to send to SCI_VOL
if(vol > 21) vol=21;
if(vol != curvol)
{
curvol=vol; // Save for later use
vol=volumetable[vol];
value=map(vol, 0, 100, 0xF8, 0x00); // 0..100% to one channel
value=(value << 8) | value;
write_register(SCI_VOL, value); // Volume left and right
}
HI dear wolle thanks for this great lib i found a little bug in this lib : VS1053::getVolume() returns wrong value ins it needs a little correction in VS1053::setVolume this is your code: void VS1053::setVolume(uint8_t vol) { uint16_t value; // Value to send to SCI_VOL if(vol > 21) vol=21; vol=volumetable[vol]; if(vol != curvol) { curvol=vol; // Save for later use value=map(vol, 0, 100, 0xF8, 0x00); // 0..100% to one channel value=(value << 8) | value; write_register(SCI_VOL, value); // Volume left and right } }
for correction please edit: void VS1053::setVolume(uint8_t vol) { uint16_t value; // Value to send to SCI_VOL if(vol > 21) vol=21;
}