Error compiling

Hey Guys, Below if the sketch of the membrane switch example that came with the kit I bought. I pasted it as is. It refuses compiling it, saying “ERROR COMPILING FOR BOARD ARDUINO/GENUINO UNO”

Your thoughts please. Thans

/* @file CustomKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates changing the keypad size and key values.
|| #
*/
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns

//define the cymbols on the buttons of the keypads

char hexaKeys[ROWS][COLS] = {
{‘1’,‘2’,‘3’,‘A’},
{‘4’,‘5’,‘6’,‘B’},
{‘7’,‘8’,‘9’,‘C’},
{’*’,‘0’,’#’,‘D’}
};
byte rowPins[ROWS] = {9, 8, 7, 6}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 4, 3, 2}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad

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

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

void loop(){
char customKey = customKeypad.getKey();

if (customKey){
Serial.println(customKey);
}
}

Please post the full error message.

When I compile your program all it reports is

Sketch uses 3038 bytes (9%) of program storage space. Maximum is 32256 bytes.
Global variables use 331 bytes (16%) of dynamic memory, leaving 1717 bytes for local variables. Maximum is 2048 bytes.

When we see your complete error message we may be able to give more help

Guys, thank you for your prompt reply. The entire error message is:

Arduino: 1.8.5 (Windows 7), Board: “Arduino/Genuino Uno”

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\chg1977\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\chg1977\AppData\Local\Temp\arduino_build_94977 -warnings=none -build-cache C:\Users\chg1977\AppData\Local\Temp\arduino_cache_626481 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose D:\arduino\RexQualis UNO R3 Starter Kit Tutorial V2.0\Lesson 17 Membrane Switch Module\Membrane_Switch_Module_Code\Membrane_Switch_Module_Code.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\chg1977\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\chg1977\AppData\Local\Temp\arduino_build_94977 -warnings=none -build-cache C:\Users\chg1977\AppData\Local\Temp\arduino_cache_626481 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose D:\arduino\RexQualis UNO R3 Starter Kit Tutorial V2.0\Lesson 17 Membrane Switch Module\Membrane_Switch_Module_Code\Membrane_Switch_Module_Code.ino
Using board ‘uno’ from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core ‘arduino’ from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used…
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard” “C:\Users\chg1977\AppData\Local\Temp\arduino_build_94977\sketch\Membrane_Switch_Module_Code.ino.cpp” -o “nul”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard” “C:\Users\chg1977\AppData\Local\Temp\arduino_build_94977\sketch\Membrane_Switch_Module_Code.ino.cpp” -o “C:\Users\chg1977\AppData\Local\Temp\arduino_build_94977\preproc\ctags_target_for_gcc_minus_e.cpp”
D:\arduino\RexQualis UNO R3 Starter Kit Tutorial V2.0\Lesson 17 Membrane Switch Module\Membrane_Switch_Module_Code\Membrane_Switch_Module_Code.ino:11:20: fatal error: Keypad.h: No such file or directory

#include <Keypad.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

Keypad.h: No such file or directory

I believe you have answered your own question.

GrooveFlotilla, I wish I could see that. Please, lead me to it. Thanks

This error means you need to install the library that contains Keypad.h. Any good tutorial would provide instructions for how to do this.

Here's the easiest way:

  • Sketch > Include library > Manage libraries
  • Wait for download to finish
  • In the "Filter your search..." box, type "keypad"
  • In the search results, click "Keypad by Mark Stanley, Alexander Brevig"
  • Click "Install"
  • Wait for installation to finish
  • Click "Close"

More information: