Hello. I am using the keypad library (Arduino Playground - Keypad Library) and am attempting to store data from a keypad, but I can't figure out what exactly is being stored as code1. The following is my code for a single digit of my passcode, to be repeated 4-6 times.
Nothing prints to serial, and some glitchy character shows up on my LCD. The issue is not with my connections.
It seems to me as if the getKey function only gives the information once per keypress, and so that is "used up" during my while loop check. Maybe. Or I am missing something else entirely.
Chars however are numbers (like int and long) and printing them will give you the numeric value. The numeric value for e.g. the character '0' is 48 decimal and 30 hexadecimal.
If you want to see the character '0' in the serial monitor, use Serial.write(code1):