I built a custom 2x8 keypad to use for a project and i've been following the examples from the arduino keypad library examples folder, and I've gotten stuck. When I go to compile I get the following error:
error: no matching function for call to 'Keypad::Keypad(char [2][9], byte [2], byte [8], unsigned int, unsigned int)'hardware\libraries\Keypad/Keypad.h:54: note: candidates are: Keypad::Keypad(char ()[5], byte, byte*, byte, byte)
hardware\libraries\Keypad/Keypad.h:53: note: Keypad::Keypad(byte*, byte*, byte, byte)
hardware\libraries\Keypad/Keypad.h:52: note: Keypad::Keypad()
hardware\libraries\Keypad/Keypad.h:50: note: Keypad::Keypad(const Keypad&)
when I compare this to the library file, I notice that it is missing one of them options, the one I am using for allowing to customize
Keypad(char userKeymap[MAX_ROWS][MAX_COLUMNS+1], byte row[], byte col[], byte rows, byte cols);
It doesnt seem happy that i'm using a digit other then - [5] (using [2][9])
Does anyone know what the problem could be? I apologize in advance if I posted this in the wrong forum.
What I have so far:
#include <Keypad.h>
#define ledPin 13
//define the symbols on the buttons of the keypads
char hexaKeys[2][9] = {
"01234567",
"890*OX><"
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these pins,
// eg. ROW0 = Arduino pin2.
byte rowPins[] = { 3, 4 };
// Connect keypad COL0, COL1, COL2 and COL3 to these pins,
// eg. COL0 = Arduino pin6.
byte colPins[] = { 12, 11, 10, 9, 8, 7, 6, 5 };
// Initialize an instance of class NewKeypad
Keypad customKeypad = Keypad(hexaKeys, rowPins, colPins, sizeof(rowPins), sizeof(colPins));
void setup()
{
digitalWrite(ledPin, HIGH);
Serial.begin(9600);
}
void loop(){
char customKey = customKeypad.getKey();
if (customKey) { // same as if(customKey != NO_KEY)
Serial.println(customKey);
}
}