LED diode controll

Hello,i'm making arduino project in witch i can control diode through lcd keypad shield, test buttons and see how long arduino is working.
The issue is with diode.
Task is to increase diode brightness through shield up/down buttons.
LCD shows that brightness is increasing, but diode isn't diode "going up".
I guess issue could be code, because diode is working
DIODE PART

[code]
void MenuC() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Speed 0 to 250:");
  while (readKeypad() != 'S') {
    x = analogRead(masterKey);
    xmax = x;
    if (xmax > 130 && xmax < 135) {
      ledUP <= ledMAX;
      ledUP += ledstep;

      lcd.setCursor(5, 2);
      lcd.print("                ");
      analogWrite(led, ledUP);
      lcd.setCursor(5, 2);
      lcd.print(ledUP);
      delay(100);
    }


  }
}

[/code]

ALL PROJECT CODE

[code]
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

int masterKey = A0;
int keypadKey = 0;
int buttonPress = 0;

char push;

byte menu = 1;
byte menuOld = 1;
byte menuAll = 4;
//______BUTTON_TEST
int x = 0;
int xmax = 1023;
String button = "None";

//_______LED_________________
byte ledUP = 0;
byte ledMAX = 255;
byte led = 2;
int ledstep = 2;
//____________

void setup() {

  pinMode(2, OUTPUT);
  lcd.begin(16, 2);
  mainMenu();
  delay(100);
}

void loop()
{
  push = readKeypad();
  menuContr();
  if (push == 'S') //enter selected menu
  {
    waitKey();
    switch (menu) {
      case 1:
        ButtonTest();
        break;
      case 2:
        MenuB();
        break;
      case 3:
        MenuC();
        break;
      case 4:
        SystemTime();
        break;
    }
    mainMenu();
    waitKey();
  }
  delay(10);
}

//____________________________
void ButtonTest() {
  lcd.clear();
  while (readKeypad() != 'S') {
    x = analogRead(masterKey);
    if ((x != 1023) && (x != xmax)) {
      lcd.setCursor(10, 0);
      lcd.print("     ");
      lcd.setCursor(10, 0);
      lcd.print(x);
      xmax = x;
      if (xmax > 475 && xmax < 480) {
        button = "Left";
      } else if (xmax < 10) {
        button = "Right";
      } else if (xmax > 130 && xmax < 135) {
        button = "Up";
      } else if (xmax > 305 && xmax < 310) {
        button = "Down";
      }
      lcd.setCursor(0, 1);
      lcd.print("        ");
      lcd.setCursor(0, 1);
      lcd.print(button);
    }
    delay(10);
  }
}

//____________________________
void MenuB() {
  lcd.clear();
  while (readKeypad() != 'S') {
    lcd.print("2");
  }
}
//____________________________
void MenuC() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Speed 0 to 250:");
  while (readKeypad() != 'S') {
    x = analogRead(masterKey);
    xmax = x;
    if (xmax > 130 && xmax < 135) {
      ledUP <= ledMAX;
      ledUP += ledstep;

      lcd.setCursor(5, 2);
      lcd.print("                ");
      analogWrite(led, ledUP);
      lcd.setCursor(5, 2);
      lcd.print(ledUP);
      delay(100);
    }


  }
}
//____________________________
void SystemTime() {
  lcd.clear();
  while (readKeypad() != 'S') {
    lcd.setCursor(6, 0);
    lcd.print("TIME");
    lcd.setCursor(7, 1);
    lcd.print(millis());
    lcd.print("s");
    delay(100);
    lcd.clear();
  }
}
//______________________________

void mainMenu() {
  lcd.clear();
  lcd.setCursor(0, 0);
  switch (menu) {
    case 1:
      lcd.print("Button test");
      break;
    case 2:
      lcd.print("Motor contr");
      break;
    case 3:
      lcd.print("LED contr");
      break;
    case 4:
      lcd.print("Syst run time");
      break;
  }
}
//____________________________
void executeAction() {
  switch (menu) {
    case 1:
      ButtonTest();
      break;
    case 2:
      MenuB();
      break;
    case 3:
      MenuC();
      break;
    case 4:
      SystemTime();
      break;
  }
}
void menuContr() {
  waitKey();
  if (push == 'U') {
    menu++;
    if (menu > menuAll)
      menu = 1;
  }
  else if (push == 'D') {
    menu--;
    if (menu == 0)
      menu = menuAll;
  }
  if (menu != menuOld) {
    mainMenu();
    menuOld = menu;
  }
}
char readKeypad() {
  keypadKey = analogRead(masterKey);
  if (keypadKey < 100)
    return 'R';
  else if (keypadKey < 200)
    return 'U';
  else if (keypadKey < 400)
    return 'D';
  else if (keypadKey < 600)
    return 'L';
  else if (keypadKey < 800)
    return 'S';
  else
    return 'N';
}
void waitKey() {
  while ( analogRead(masterKey) < 800) {}
}

[/code]

You’re doing analogWrite to pin 2.

Which board are you using?

@TheMemberFormerlyKnownAsAWOL i guess it could be keypad shield, keypad shield is connected on top of arduino

I don’t understand your reply.

@TheMemberFormerlyKnownAsAWOL I’m using lcd keypad shield, witch in mounted on arduino uno

Ok.
What does the reference say about doing analogWrite to pin 2 on a Uno?

ok i changed to pin 3, but it still didn't work

I can’t see your code.

Remove the LCD/keyboard shield and look at the designations near the pins.....
I made a quick change of a working design and made the same mistake recently....

TheMemberFormerlyKnownAsAWOL:
I can't see your code.

Why not? I can.

Railroader:
Remove the LCD/keyboard shield and look at the designations near the pins.....
I made a quick change of a working design and made the same mistake recently....

Ok, I took off shield, as i understand i'm using wrong pin.
As i understand, for analog output i must use pin 3.
And i switched to pin 3, but led diode still doesn't increase its brightness

i switched to A1 pin and it work, thanks you all

jankeljs:
Ok, I took off shield, as i understand i'm using wrong pin.
As i understand, for analog output i must use pin 3.
And i switched to pin 3, but led diode still doesn't increase its brightness

Did You recompile and download the code as well?

Using A-pins for PWM is new to me. Didn't know they could do that. Checking reference now.....

Check this page: analogWrite() - Arduino Reference

Railroader:
Why not? I can.

I can’t see the amended code - how come you can?

TheMemberFormerlyKnownAsAWOL:
I can’t see the amended code - how come you can?

The second code tagged window in the very first post shows it. Not the code used?