Switch statement not working

is the switch statement correct i can't seem to get it to work. i can see it gets into the while loop but does not start the switch statement

#include <PinChangeInterrupt.h>
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
hd44780_I2Cexp lcd;
// Const Variables and pin assinged
const byte ENC_SW = 3; // Encoder Switch
const byte ENC_PinA = 6; // PIN A of Encoder
const byte ENC_PinB = 8; // PIN B of Encoder
const byte buttonPin = 9; // Weld button
// Variables
byte prevENC_SWstate = HIGH;
byte ENC_SWstate = HIGH;
byte Inconfig; // Display config
int ENC_PinAState = LOW;
int ENC_PinALastState = LOW;
int Counter1;
unsigned long TimeStamp;
unsigned long ENC_SWpressDuration;
unsigned long delayTime = 50;
void setup()
{
  lcd.begin(16, 2);
  lcd.clear();
  pinMode(ENC_PinA, INPUT_PULLUP);
  pinMode(ENC_PinB, INPUT_PULLUP);
  pinMode(ENC_SW, INPUT_PULLUP);
  attachPCINT(digitalPinToPCINT(ENC_PinA), rotaryEncoder, CHANGE);
  lcd.setCursor(5, 0);
  lcd.print("Start");
  delay(1000);
  lcd.clear();
  Serial.begin(115200);
}

void loop()
{
  byte InMenu = false;
  byte select;
  lcd.setCursor(0, 0);
  lcd.print("W1:10");
  lcd.setCursor(0, 1);
  lcd.print("W2:20");
  lcd.setCursor(9, 0);
  lcd.print("T:29");
  lcd.setCursor(9, 1);
  lcd.print("P:20");
  lcd.print("%");
  ENC_SWstate = digitalRead(ENC_SW);
  if (ENC_SWstate == LOW && prevENC_SWstate == HIGH)
  {
    delay(20);
    ENC_SWstate = digitalRead(ENC_SW);
    if (ENC_SWstate == LOW && prevENC_SWstate == HIGH)
    {
      TimeStamp = millis();
    }
  }
  if (ENC_SWstate == HIGH && prevENC_SWstate == LOW)
  {
    delay(20);
    ENC_SWstate = digitalRead(ENC_SW);
    if (ENC_SWstate == HIGH && prevENC_SWstate == LOW)
    {
      ENC_SWpressDuration = (millis() - TimeStamp);
    }
  }
  if (ENC_SWpressDuration > 0 && ENC_SWpressDuration >= delayTime)
  {
    Inconfig = 1;
  }

  while (Inconfig == 1)
  {
    int select = 0;
    select = readEncoder() % 4;
    prevENC_SWstate = ENC_SWstate;
    switch (select)
    {
case1:
        clearSelectPointer(1);
        Serial.println(select);
        lcd.setCursor(5, 0);
        lcd.print("<");
        break;
case2://W2
        clearSelectPointer(2);
        lcd.setCursor(5, 1);
        lcd.print("<");
        break;
case3://P
        clearSelectPointer(3);
        lcd.setCursor(15, 1);
        lcd.print("<");
        Inconfig = 0;
        break;        
    }
  }
}

void rotaryEncoder()
{
  ENC_PinAState = digitalRead(ENC_PinA);
  if (digitalRead(ENC_PinB) != ENC_PinAState)
  {
    Counter1--;
  }
  else
  {
    Counter1++;
  }
}

int readEncoder()
{
  noInterrupts();
  int copyCounter = Counter1;
  interrupts();
  return (copyCounter) >> 1;
}

int clearSelectPointer(int checkPointer)
{
  switch (checkPointer) {
    case 1:// for select 1
      lcd.setCursor(6, 1); // 2
      lcd.print(" ");
      lcd.setCursor(15, 1); // 3
      lcd.print(" ");
      break;
    case 2:// for select 2
      lcd.setCursor(6, 0); // 1
      lcd.print(" ");
      lcd.setCursor(15, 1); // 3
      lcd.print(" ");
      break;
    case 3:// for select 3
      lcd.setCursor(6, 0); // 1
      lcd.print(" ");
      lcd.setCursor(6, 1); // 2
      lcd.print(" ");
      break;
  }
}

What is the value of "select"?

value from the rotary encoder at the start of the while loop

void rotaryEncoder()
{
  ENC_PinAState = digitalRead(ENC_PinA);
  if (digitalRead(ENC_PinB) != ENC_PinAState)
  {
    Counter1--;
  }
  else
  {
    Counter1++;
  }
}

int readEncoder()
{
  noInterrupts();
  int copyCounter = Counter1;
  interrupts();
  return (copyCounter) >> 1;
}

No - doesn't answer my question.

I think you want

case 1:

not

case1:

and so on ......

AWOL:
No - doesn't answer my question.

Thought you meant where does the select get its data from. It increments and decrements based on the encoder.

leongjerland:
I think you want

case 1:

not

case1:

and so on ......

nope that wasn't it.

nope that wasn't it.

But it made things better.