'1' is a character with ASCII code 49. use 1 if you want 1. or compare key == '1' or use case '1':, not case 1:
char key = getKey();
Serial.println(key); // will print 1 for '1' because of the type char
'1' is a character with ASCII code 49. use 1 if you want 1. or compare key == '1' or use case '1':, not case 1:
char key = getKey();
Serial.println(key); // will print 1 for '1' because of the type char