LCD Encoder Menu

Hi,

This all seem's to be working.

When I press the encoder switch "input 2", I can change the state of the LED on and off, but I still can't get into changing the value or parameters.

What am I missing?

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#include <Encoder.h>
Encoder myEnc(20, 21);

//Input & Button Logic
const int numOfInputs = 3;
const int inputPins[numOfInputs] = {20, 21, 53};
int inputState[numOfInputs];
int lastInputState[numOfInputs] = {LOW, LOW, LOW};
bool inputFlags[numOfInputs] = {LOW, LOW, LOW};
long lastDebounceTime[numOfInputs] = {0, 0, 0};
long debounceDelay = 10;
int backlight_pin10 = 10;

//LCD Menu Logic
const int numOfScreens = 10;
int currentScreen = 0;
const char* screens[numOfScreens][2] = {{"1Motor Voltage", "Volts"}, {"2Motor Current", "Amps"},
  {"3Motor Rated HP", "HP"}, {"4Overload Temp.", "degC"}, {"5Accel Time", "Secs"}, {"6Restart Time", "Mins"},
  {"7Analog Out. Curr.", "mA"}, {"8Input Temp.", "degC"}, {"9Run Time", "Hours"}, {"10Start Times", "times"}
};
//int button = 53;
int led = 13;
int dizzwold = false;
int parameters[numOfScreens];

void setup() {
  pinMode(backlight_pin10, OUTPUT);
  analogWrite(10, 200);
  for (int i = 0; i < numOfInputs; i++) {
    pinMode(inputPins[i], INPUT);
    digitalWrite(inputPins[i], HIGH); // pull-up 20k
  }
  pinMode(led, OUTPUT);
  //pinMode(button, INPUT_PULLUP); // set the internal pull up resistor, unpressed button is HIGH
  Serial.begin(9600);
  lcd.begin(20, 4);
}

long old = 0;

void loop() {
  setInputFlags();
  resolveInputFlags();

}

void setInputFlags() {
  for (int i = 0; i < numOfInputs; i++) {
    int reading = digitalRead(inputPins[i]);
    if (reading != lastInputState[i]) {
      lastDebounceTime[i] = millis();
      Serial.println(reading);
    }
    if ((millis() - lastDebounceTime[i]) > debounceDelay) {
      if (reading != inputState[i]) {
        inputState[i] = reading;
        if (inputState[i] == HIGH) {
          inputFlags[i] = HIGH;
        }
      }
    }
    lastInputState[i] = reading;
  }
}

void resolveInputFlags() {
  for (int i = 0; i < numOfInputs; i++) {
    if (inputFlags[i] == HIGH) {
      inputAction(i);
      inputFlags[i] = LOW;
      printScreen();
    }
  }
}

void inputAction(int input)
{
  long newP = myEnc.read();
  {
    if (input == 0)
    {
      if (newP < old)
      {
        old = newP;
        if (currentScreen == 0 && 1)
        {
          currentScreen = numOfScreens - 1;
        }
        else
        {
          currentScreen--;
        }
      }
    }
    else if (input == 1)
    {
      if (newP > old)
      {
        old = newP;
        if (currentScreen == numOfScreens - 1)
        {
          currentScreen = 0;
        }
        else
        {
          currentScreen++;
        }
      }
    }

    else if (input == 2);
    {
      dizzwold = ! dizzwold;
      digitalWrite(led, dizzwold);
      if (newP < old)
        old = newP;
      {
        parameterChange(1);
      }
      if (newP > old)
        old = newP;
      {
        parameterChange(0);
      }
    }
  }
}




void parameterChange(int key) {
  if (key == 0) {
    parameters[currentScreen]++;
  } else if (key == 1) {
    parameters[currentScreen]--;
  }
}

void printScreen() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(screens[currentScreen][0]);
  lcd.setCursor(0, 1);
  lcd.print(parameters[currentScreen]);
  lcd.print(" ");
  lcd.print(screens[currentScreen][1]);
}

Dizzwold.