That should fix the mess your loop function has become.
void loop(){
char key = keypad.getKey();
switch (key) {
case NO_KEY:
// No key read. Do nothing
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
// Digits from 0 to 9
// Don't forget we deal with ASCII characters and not numbers
value = value * 10 + key[glow] - '0'[/glow];
break;
case 'e':
// Enter key
Serial.println ();
Serial.print ("You have chosen to be spanked ");
Serial.print (value);
Serial.println (" times by our lovely hostess Gertrude.");
// Additional processing for value goes in here
// ...
// Reset value. The last number is done
value = 0;
break;
default:
// All other keys
Serial.println ();
Serial.print ("Criminy! Don't press key '");
Serial.print (key);
Serial.println ("'! Another ");
Serial.print (value);
Serial.println (" puppies died in China.");
// Reset value. The last number is done
value = 0;
}
}
Note the highlight, that was the reason for the strange value you got. You simply forgot to convert from ascii to the value of the digit.
Korman