Nokia 5110 BL help please "solved"

Hi all,

Hoping someone will be kind enough to help me with a vario project I have made of another persons sketch/design. Pro Mini 5v 16MHz, Nokia 5510, rotary encoder. The problem is with 5110 BL, the action of the light, off to brightest needs to be inverted. The BL in on when display says it should be off.

display/BL
Off is brightest
1
2
3
4 is least bright
5 is off

Sequence repeats with cw rotation of encoder.
I want display order and cw repeat sequence of rotary encoder to remain the same, just need action of BL itself inverted to match display. Any help much appreciated, thanks Davo

case MENU_LIGHT:
{
conf.light_cpt = updateConfItem(conf.light_cpt, dir, -1);

if (conf.light_cpt <= 0)
conf.light_cpt = 0;

if (conf.light_cpt >= 5) {
conf.light_cpt = 5;
display.print(F(“Off”));
}
else {
display.print(5 - conf.light_cpt);
}
updateBrightness();
}
break;

So i need

Display/BL

Off is off 1 2 3 4 5 is brightest

thanks

Sorry all, looks like I posted this in wrong place. It's late, my bad. Here now, if you want me to move it just let me know.

Davo

solved, problem was further down in sketch

changed (PIN_LIGHT, conf.light_cpt * 51) to (PIN_LIGHT,(5 - conf.light_cpt) * 51);