_keypad.begin() gets called in the constructor. I don't believe there is a reason to call it twice. Thank you for the note about using begin()...I will switch.
So the test script worked perfectly...all I am doing currently is
void Keyblock::getKey() {
char key = _keypad.getKey();
if (key != NO_KEY){
_debug.write("Key Pressed : ").line(key);
}
}
So maybe the issue is actually something do with my debug class?
class Debug {
private:
bool _state = false;
public:
void init();
Debug& line(const char *str);
Debug& line(int);
Debug& write(const char *str);
Debug& write(int);
void newline();
};
void Debug::init(){
if (!_state){
Serial.begin(9600);
delay(1000);
_state = true;
line("Debug Started");
}
}
Debug& Debug::line(const char *messageChar) {
if (_state){
const char *p;
p = messageChar;
while (*p) {
Serial.print(*p);
p++;
}
newline();
}
return *this;
}
Debug& Debug::line(int messageInt) {
if (_state){
Serial.print(messageInt);
newline();
}
return *this;
}
Debug& Debug::write(const char *messageChar) {
if (_state){
const char *p;
p = messageChar;
while (*p) {
Serial.print(*p);
p++;
}
}
return *this;
}
Debug& Debug::write(int messageInt) {
if (_state){
Serial.print(messageInt);
}
return *this;
}
void Debug::newline() {
if (_state){
Serial.println();
}
}