Change brightness LED problem

I had a problem while making a PWM LED change brightness. I used an IRremote.

The problem is that i want to turn on the LED with button “EQ”. That works fine. Than I want button “+” and “-” to change brightness. That works, but it also changes the brightness while the LED is LOW (checked it on the Serial Monitor). Another problem is that you can turn on the LED with the “+” and “-” button.

The code (the part that matters) looks like this:

case 0xFF906F: //button EQ
analogWrite (led, brightness);
pushCounter++;
break;

case 0xFFA857: //button +
if (led != LOW) {
brightness = brightness + 20;
analogWrite (led, brightness);
}
break;

case 0xFFE01F: //button -
if (led != LOW) {
brightness = brightness - 20;
analogWrite (led, brightness);
}
break;

}

if (brightness <= 25) { //this code for anti-glitching
brightness = 25;
}

if (brightness >= 235) { //anti-glitching
brightness = 235;
}

if (pushCounter == 2) {
digitalWrite (led, LOW);
pushCounter = 0;
}

My question is how to change the code so you can only change the brightness with the “+” and “-” button (and not turn the LED on) while the LED is on.

if (led != LOW) { Given that led appears to be a pin number, this is almost guaranteed.

Please remember to auto format (indent) code before posting, and use code tags when posting code.

I looked an hour for the solution and posted this question, but soon after I realised it was just a stupid mistake. Just as you said it was a pin number. I'm sorry for this stupid question. I had to take a closer look.

But thanks by the way