Error compiling for board SparkFun Pro Micro

Hey, I'm pretty new to Arduino and I am currently making a macro pad with 5 switches and a rotary encoder. I've downloaded and installed the SparkFun Pro Micro and the first time I've tried to verify and upload it says this:

< #include <HID-Project.h>
#include <HID-Settings.h>
#include <Encoder.h>
#include <Bounce2.h>
#include <Keyboard.h>

//Set up the button grid
const int numButtons = 5;
const int buttonPins[numButtons] = {9,8,7,6,5}; //defining the pins in an order from right to left
int state = 0; //Set the current state
//Set up all the buttons as bounce objects
Bounce buttons = {Bounce(buttonPins[0],10),Bounce(buttonPins[1],10),Bounce(buttonPins[2],10),Bounce(buttonPins[3],10),Bounce(buttonPins[4],10)};

//Set up the encoder
const int encoderButtonPin = 10;
Encoder volumeKnob(14,15); //Set up the encoder as an Encoder object
Bounce encoderButton = Bounce(encoderButtonPin,10); //Set up to the encoder button as a Bounce object
int timeLimit = 500; //Cut off time for play/pause or skip

void setup() {
Keyboard.begin(); //Start the Keyboard object

for(int i = 0; i < numButtons; i++){
pinMode(buttonPins[i], INPUT_PULLUP);

pinMode(encoderButtonPin, INPUT_PULLUP);
long positionLeft = -999;
void loop() {
//check all buttons
for(int j = 0; j < numButtons; j++){

//use the current state and the button number to find the command needed and send it.
switch (state) {
case 0: //Layout 1
switch (j) {

case 0: //F6;
case 1: //;
case 2: //;
case 3: //;
case 4: //;

//encoder play pause
if(encoderButton.update()) {
if(encoderButton.fallingEdge()) {
int fall = millis();
int rise = millis();
Serial.println(rise - fall);
if(rise - fall > timeLimit){;
} else {;
long positionLeft = -9;
long positionRight = -9;

//encoder volume changing
long newLeft;
newLeft =;

if(newLeft != positionLeft){
if((newLeft - positionLeft) > 0) {
Serial.println("volume up");;
} else {
Serial.println("volume down");;
positionLeft = newLeft;
} >

Hi @pyrothmatic.

I'm going to ask you to post some additional information that might help us to identify the problem.

Please do this:

  1. When you encounter an error, you'll see a button on the right side of the orange bar in the Arduino IDE: Copy error messages (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  2. Open a forum reply here by clicking the Reply button.
  3. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  4. Press Ctrl+V. This will paste the compilation output into the code block.
  5. Move the cursor outside of the code block markup before you add any additional text to your reply.
  6. Click the Reply button to post the output.
Arduino: 1.8.13 (Windows 10), Board: "SparkFun Pro Micro, ATmega32U4 (3.3V, 8 MHz)"

In file included from c:\users\190240\documents\arduino\libraries\hid-project\src\hid-apis\KeyboardAPI.h:29:0,

                 from c:\users\190240\documents\arduino\libraries\hid-project\src\hid-apis\defaultkeyboardapi.h:27,

                 from C:\Users\190240\Documents\Arduino\libraries\HID-Project\src/SingleReport/BootKeyboard.h:30,

                 from C:\Users\190240\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:50,

                 from C:\Users\190240\Desktop\Electronic Tech Macropad\Macropad_Code\Macropad_Code.ino:1:

c:\users\190240\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:54:21: note: #pragma message: Using default ASCII layout for keyboard modules

     #pragma message "Using default ASCII layout for keyboard modules"


In file included from C:\Users\190240\Desktop\Electronic Tech Macropad\Macropad_Code\Macropad_Code.ino:5:0:

C:\Program Files (x86)\Arduino\libraries\Keyboard\src/Keyboard.h:95:7: error: redefinition of 'class Keyboard_'

 class Keyboard_ : public Print


In file included from C:\Users\190240\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:51:0,

                 from C:\Users\190240\Desktop\Electronic Tech Macropad\Macropad_Code\Macropad_Code.ino:1:

C:\Users\190240\Documents\Arduino\libraries\HID-Project\src/MultiReport/ImprovedKeyboard.h:33:7: note: previous definition of 'class Keyboard_'

 class Keyboard_ : public DefaultKeyboardAPI


exit status 1

Error compiling for board SparkFun Pro Micro.

This is the error code

It looks like the HID-Project library and the Keyboard library you are using are incompatible with each other. If I understand correctly, the HID-Project library's "ImprovedKeyboard" is a replacement for the Keyboard library, so it makes no sense at all to try to use both at the same time. Please study the HID-Project library's extensive documentation to learn how to use it correctly:

Alternatively, you might find it much easier to just use the standard Keyboard library alone. That library might well meet all your needs. The Keyboard library's documentation is here:

@pyrothmatic, your topic has been moved to a more suitable location on the forum.

ATmega32U4 (3.3V, 8 MHz)"

Are you sure the Pro Micro is the 3.3V variant? The 5 V/16 MHz version is much more common.

I changed that by mistake it is meant to be 5v, thanks for reminding me.

Thank you so much for your help, it worked after I deleted the keyboard library.

You're welcome. I'm glad to hear it's working now. Enjoy!