Quote:
Originally Posted by Ardent
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
const char brightString[] PROGMEM = {
"HIGH\0"
" MED\0"
" LOW\0"
" OFF\0"
};
//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 = "));
printStr(brightString, brightnessIdx);
clrEOL();
gotoXY(0, 1);
clrEOL();
holdDisplay = holdDelay;
}
|
Done. I've added the above code in (made a few changes - hope you don't mind). I've made it selectable at compile-time via a "#define".