Multiple digit input from 3*4 keypad

Hello all,

I am new in that platform, Hope someone gives some guidance or instruction for my project.

I try to get input from the 3*4 keypad. I have the code for a single digit, but I need 4-6 multiple digits variables codes.

Any advice would be greatly appreciated!
Thank you.

Here is my code,

#include<Wire.h>
#include <Keypad.h>

const byte rows = 4; //4 rows
const byte cols= 3; //3 columns

char Keys[rows][cols] = {

{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}

};
byte rowPins[rows] = {13,12,11,10};
byte colPins[cols] = {A0,A1,A2};

Keypad customKeypad = Keypad( makeKeymap(Keys), rowPins, colPins, rows, cols);

void setup() {

Serial.begin (9600);
delay (50);

}

void loop(){

char customKey = customKeypad.getKey();
if (int(customKey) !=0)

{

Serial.pirntln (customkey);

}

}

Have a look at this guy's password code which takes key strokes into an array. His particular one stops when it has 4 characters, but that could obviously be changed.

(Note: in some ways it's quite messy code, but it does work. I'm not endorsing it in any way, just pointing you at it.)

(Edit, Note2: I say "this guy's code" but of course I don't know if he actually wrote it, so have no idea if he can give any advice on your question.)

Nothing to do with your question but I always amazed at how badly formatted some code is when posted here which to me makes it difficult to work with.

Here is the original code reformatted using Auto Format in the IDE and with spurious blank line removed. To me it is easier to read and follow. Note also the use of code tags when posted here

#include<Wire.h>
#include <Keypad.h>

const byte rows = 4; //4 rows
const byte cols = 3; //3 columns
char Keys[rows][cols] =
{
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};
byte rowPins[rows] = {13, 12, 11, 10};
byte colPins[cols] = {A0, A1, A2};

Keypad customKeypad = Keypad( makeKeymap(Keys), rowPins, colPins, rows, cols);

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

void loop()
{
  char customKey = customKeypad.getKey();
  if (int(customKey) != 0)
  {
    Serial.pirntln (customkey);
  }
}

Note this error in the code

    Serial.pirntln (customkey);