Hello, I want to ask why the second switch() doesn't working. First one with the case '#' is working fine but next one isn't.
void loop()
{
char key = keypad.getKey();
if (key != NO_KEY){
switch(key) {
case '#':
lcd.clear();
lcd.print("Setting Mode");
lcd.setCursor(0,1);
lcd.print(" Hour:");
delay(500);
key = NO_KEY;
int first_hour;
int second_hour;
unsigned long _start_time = millis();
while(((key = keypad.getKey()) == NO_KEY) && ((millis()-_start_time) < 10000))
{ // Do nothing
}
if (key != NO_KEY) {
key = keypad.getKey();
/* switch (key){
case '0':
first_hour = 0;
lcd.print (first_hour);
delay (300);
break;
case '1':
first_hour = 1;
lcd.print (first_hour);
delay (300);
break;
case '2':
first_hour = 2;
lcd.print (first_hour);
delay (300);
break;
case '3':
first_hour = 3;
lcd.print (first_hour);
delay (300);
break;
case '4':
first_hour = 4;
lcd.print (first_hour);
delay (300);
break;
case '5':
first_hour = 5;
lcd.print (first_hour);
delay (300);
break;
case '6':
first_hour = 6;
lcd.print (first_hour);
delay (300);
break;
case '7':
first_hour = 7;
lcd.print (first_hour);
delay (300);
break;
case '8':
first_hour = 8;
lcd.print (first_hour);
delay (300);
break;
case '9':
first_hour = 9;
lcd.print (first_hour);
delay (300);
break;
}
*/
}
while(((key = keypad.getKey()) == NO_KEY) && ((millis()-_start_time) < 10000))
{ // Do nothing
}
if (key != NO_KEY) {
key = keypad.getKey();