|
Hi Nick,
I have encountered errors while programming which is the programming line below highlighted in red, the keypad defining kpd, the program cannot read it as a type. I am using a Waspmote board instead of arduino. I placed the keypad.cpp and keypad.h file in the library and followed your instructions to rewrite the keypad library, the program manages to read the 'Keypad' defining the kpd as the colour of the 'keypad' changes. However, the error still persists. The error states : "Keypad does not name a type in function void loop()".
The following is my code:
const byte ROWS = 4; //four rows const byte COLS = 3; //three columns char keys[ROWS][COLS] = { {'1','2','3'}, {'4','5','6'}, {'7','8','9'}, {'#','0','*'} }; byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){ USB.begin(); } void loop(){ byte key = kpd.getKey(); if (key != NO_KEY){ USB.println(key); } }
Please advice Thanks in advance.
|