Skip to content

Commit

Permalink
Save tftbrightness if it is changed on the touch screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
CelliesProjects committed May 26, 2018
1 parent 1235b44 commit 90111c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tfttask.ino
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ static inline __attribute__((always_inline)) void showMenu()
else if ( button.pressed( BL_SLIDER_AREA , clickedLocation ) )
{
static uint16_t oldLocation;
if ( !( clickedLocation.y == oldLocation ) )
if ( clickedLocation.y != oldLocation )
{
tftBrightness = map( clickedLocation.y , BL_SLIDER_YPOS, BL_SLIDER_HEIGHT + BL_SLIDER_YPOS, 100, 0 );
preferences.putFloat( "tftbrightness", tftBrightness );
oldLocation = clickedLocation.y;
}
}
Expand Down

0 comments on commit 90111c6

Please sign in to comment.