Does not name a type

Keypad customKeypad = Keypad(makeKeymap(keyBoardArray), rowPins, colPins, ROWS, COLS);

Please READ THIS POST to help you get the best out of the forum.

SIMPLE TROUBLESHOOTING.

These steps may also save you some unnecessary time and effort in the forum.

COMMON ISSUES

  • Check you have a COMMON GROUND where required.

  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.

  • Try other computers where possible.

  • Try other USB leads where possible.

  • You may not have the correct driver installed. CH340/341 or CP2102

  • There may be a problem with the board check your wiring first.

  • Remove any items connected to pins 0 and 1.
    COMPUTER RELATED

  • Ensure you turn off any additional security / antivirus just to test.

  • There may be a problem with the PC try RESTARTING it.

  • You may be selecting the wrong COM port.

  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.

  • Clear your browsers CACHE.

  • Close the IDE before using any other serial programs.

  • Preferably install IDE’s as ADMINISTRATOR or your OS equivalent
    Performing the above actions may help resolve your problem without further help.

Bob.

#include <Keyboard.h>
const byte ROWS = 4;
const byte COLS = 4;
char keyBoardArray [ROWS][COLS] = {

{‘1’,‘2’,‘3’,‘A’},
{‘4’,‘5’,‘6’,‘B’},
{‘7’,‘8’,‘9’,‘C’},
{’*’,‘0’,’#’,‘D’}

};

byte rowPins[ROWS]= {9,8,7,6};
byte colPins[COLS] = {5,4,3,2};

Keypad customKeypad = Keypad ( makeKeymap(keyBoardArray), rowPins, colPins, ROWS, COLS);

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

void loop() {
char keyboard = customKeypad.getKey();
Serial.println(keyboard);

}

THE EROR IS: "Does not name a type "

Sorry but that is NOT how you post code and error messages. Please use the links already provided.

It will save you a lot of issues later on.

Bob.

You obviously did not read the first link that was provided. Anyway

Keypad != Keyboard

Keyboard.h is nothing to do with Keypad.h

You probably look at the code and dont actually read it, its common failing when looking at something you wrote yourself - seeing what you think you put, rather than what's actually there. It helps to read it out to yourself sometimes as silly slips can sound more wrong than they look.