I know there is probably something stupid that i'm missing, but I just can't seem to figure this one out.
Error:
In file included from impact_v1_1.ino:3:
keypad_4x4.h:8: error: expected class-name before '{' token
impact_v1_1.ino:
#include <LiquidCrystal.h>
#include "keypad_4x4.h"
void setup()
{
keypad_4x4 myKeypad;
myKeypad.keyInput();
}
void loop()
{
}
keypad_4x4.h
#ifndef KEYPAD_4X4_H
#define KEYPAD_4X4_H
#include <WProgram.h>
#include <Keypad.h>
class keypad_4x4 : public Keypad
{
public:
keypad_4x4();
~keypad_4x4();
static const int rowPins[4];
static const int colPins[4];
void keyInput();
private:
static const char keys[4][4];
};
#endif
keypad4x4.cpp
#include "keypad_4x4.h"
keypad_4x4::keypad_4x4()
{
Keypad(makeKeymap(keys), rowPins, colPins, 4, 4)
}
char const keypad_4x4::keys[4][4] =
(
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'#', '0', '*', 'D'}
);
byte const keypad_4x4::rowPins[4] = {9, 8, 7, 6};
byte const keypad_4x4::colPins[4] = {13, 12, 11, 10};
keypad_4x4::keyInput()
{
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
lcd.begin(16, 2);
lcd.print("keypad run");
delay(5000);
}
Thanks in advance.