Go Down

Topic: Input multiple values to arduino from 4x4 membrane keypad (Read 595 times) previous topic - next topic

tempiling

Hi all, so i found this website http://experimentaltechnik.com/matrix-keypad-pin-reduction
That way, i can use the 4x4 membrane keypad with only 1 analog pin. I've tried it and it worked.
My question is how can i press more than 1 button so it will become one like "123" just like in the calculator? and can i make the input from keypad to string data type?

Here's my codes

Code: [Select]
#include
#define analogPin 0
AnalogMatrixKeypad AnMatrixKeypad(analogPin);

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

void loop(){
char Key = AnMatrixKeypad.readKey();
if(Key != KEY_NOT_PRESSED)
Serial.println(Key);
}

Go Up