Open JOliverasC opened 4 years ago
@Edzelf Firts: it's an awsome project, congratulations and thanks for sharing I realised that displayvolume is always redrawing the bar and the code should be something similar to (Changes in bold)
void displayvolume() {
static uint8_t oldvol = 0 ; // Previous volume uint8_t pos ; // Positon of volume indicator uint8_t vol = 0 ;
vol = vs1053player.getVolume(); if ( vol != oldvol ) // before ..if ( vs1053player.getVolume() != oldvol ) { pos = map ( vs1053player.getVolume(), 0, 100, 0, 160 ) ; tft.fillRect ( 0, 126, pos, 2, RED ) ; // Paint red part tft.fillRect ( pos, 126, 160 - pos, 2, GREEN ) ; // Paint green part oldvol = vol; }
}
@Edzelf Firts: it's an awsome project, congratulations and thanks for sharing I realised that displayvolume is always redrawing the bar and the code should be something similar to (Changes in bold)
void displayvolume() {
if defined ( USETFT )
static uint8_t oldvol = 0 ; // Previous volume uint8_t pos ; // Positon of volume indicator uint8_t vol = 0 ;
vol = vs1053player.getVolume(); if ( vol != oldvol ) // before ..if ( vs1053player.getVolume() != oldvol ) { pos = map ( vs1053player.getVolume(), 0, 100, 0, 160 ) ; tft.fillRect ( 0, 126, pos, 2, RED ) ; // Paint red part tft.fillRect ( pos, 126, 160 - pos, 2, GREEN ) ; // Paint green part oldvol = vol; }
endif
}