Re: Keypad for Gated Entry

If we take the following code for example:
How can i change serial.println(key) to sore the key entered? I dont think i coud use serial.write(key) can i? If so how would i know where it writes to? In an array or EEPROM? If i store in EEPROM then i am using the analogeRead(0). This cant be can it? Its an analog pin (0) the keys are from digital pins. Or am i just completely lost....? Thanks.

#include <Keypad.h>

byte rows = 4; //four rows
byte cols = 5; //four columns
byte rowPins[] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
byte colPins[] = {5, 6, 7, 8, 9}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad(rowPins,colPins,rows,cols);

void setup(){
Serial.begin(9600);
}

void loop(){
char key = keypad.getKey();

if (key != NO_KEY){
Serial.println(key);
}
}