View Single Post
Old 09-27-2013, 10:33 AM   #87 (permalink)
Ardent
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Here are some backlight code changes I like: (items need to be placed in their proper locations)

Code:
//Backlight range changes
const uint8_t brightness[] PROGMEM = { 0, 85, 170, 255 }; //middle button cycles through these brightness settings
//Changed 0 to 3 for OFF while sleeping
LCD::setBright(3); // set backlight brightness to zero
//Initial brightness
uint8_t brightnessIdx = 2;  //brightness at startup. 2 = LOW
//Descriptive brightness labels
void doNextBright(void) {
	brightnessIdx++;
	if (brightnessIdx >= brightnessLength) brightnessIdx = 0;
	LCD::setBright(brightnessIdx);
	printFlash(PSTR("Backlight = "));
   if (brightnessIdx == 0) {
     printFlash(PSTR("HIGH"));
   } else if (brightnessIdx == 1) {
     printFlash(PSTR(" MED"));
   } else if (brightnessIdx == 2) {
     printFlash(PSTR(" LOW"));
   } else if (brightnessIdx == 3) {
     printFlash(PSTR(" OFF"));
   }
   gotoXY(0, 1);
	printFlash(PSTR("                "));
	holdDisplay = holdDelay;
}
  Reply With Quote
The Following User Says Thank You to Ardent For This Useful Post:
t vago (09-27-2013)