Error/issue with verifiy/upload to Arduino

Hi,

I am writing code to mine MacroKeyboard with a display and encoder. But I have a problem. Every single time I Klik on Verify or Upload, the "error" message displays "Compilation error: exit status 1" and in the OUTPUT window is a very "long text". I think that it is talking about libraries, but I think I have them alright.
Here is the "long text".

In file included from C:\Users\holom\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:42:0,
from C:\Users\holom\Desktop\CODE MACRO KEYBOARD\sketch_dec18a\sketch_dec18a.ino:15:
C:\Users\holom\Documents\Arduino\libraries\HID-Project\src/MultiReport/ImprovedMouse.h:33:7: error: redefinition of 'class Mouse_'
class Mouse_ : public MouseAPI
^~~~~~
In file included from C:\Users\holom\Desktop\CODE MACRO KEYBOARD\sketch_dec18a\sketch_dec18a.ino:10:0:
C:\Users\holom\Documents\Arduino\libraries\Mouse\src/Mouse.h:42:7: note: previous definition of 'class Mouse_'
class Mouse_
^~~~~~
In file included from c:\users\holom\documents\arduino\libraries\hid-project\src\hid-apis\KeyboardAPI.h:29:0,
from c:\users\holom\documents\arduino\libraries\hid-project\src\hid-apis\defaultkeyboardapi.h:27,
from C:\Users\holom\Documents\Arduino\libraries\HID-Project\src/SingleReport/BootKeyboard.h:30,
from C:\Users\holom\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:50,
from C:\Users\holom\Desktop\CODE MACRO KEYBOARD\sketch_dec18a\sketch_dec18a.ino:15:
c:\users\holom\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\holom\Desktop\CODE MACRO KEYBOARD\sketch_dec18a\sketch_dec18a.ino:8:0:
C:\Users\holom\Documents\Arduino\libraries\Keyboard\src/Keyboard.h:52:27: error: expected identifier before numeric constant
#define KEY_RETURN 0xB0
^
c:\users\holom\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:103:5: note: in expansion of macro 'KEY_RETURN'
KEY_RETURN = 40, // Alias
^~~~~~~~~~
C:\Users\holom\Documents\Arduino\libraries\Keyboard\src/Keyboard.h:52:27: error: expected '}' before numeric constant
#define KEY_RETURN 0xB0
^
c:\users\holom\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:103:5: note: in expansion of macro 'KEY_RETURN'
KEY_RETURN = 40, // Alias
^~~~~~~~~~
C:\Users\holom\Documents\Arduino\libraries\Keyboard\src/Keyboard.h:52:27: error: expected unqualified-id before numeric constant
#define KEY_RETURN 0xB0
^
c:\users\holom\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:103:5: note: in expansion of macro 'KEY_RETURN'
KEY_RETURN = 40, // Alias
^~~~~~~~~~
In file included from c:\users\holom\documents\arduino\libraries\hid-project\src\hid-apis\KeyboardAPI.h:29:0,
from c:\users\holom\documents\arduino\libraries\hid-project\src\hid-apis\defaultkeyboardapi.h:27,
from C:\Users\holom\Documents\Arduino\libraries\HID-Project\src/SingleReport/BootKeyboard.h:30,
from C:\Users\holom\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:50,
from C:\Users\holom\Desktop\CODE MACRO KEYBOARD\sketch_dec18a\sketch_dec18a.ino:15:
c:\users\holom\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:521:1: error: expected declaration before '}' token
};
^

exit status 1

Compilation error: exit status 1

Please help i am lost :confused:

If someone can translate for me what that means i will be happy.

Welcome to the forum

Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

Please post your full sketch, using code tags when you do

/***********************************************************************************************************************************
Code for PADys(micropad) with execories - go watch a video about it → SOON WILL BE SOME
Made by → Jendys/Jendyx in 2022
email→ korky707@gmail.com
PS:Make sure you are using Arduino Pro micro 5V Atmega 32U4 board with build in 5V USB controler, it will be much more easy.
***********************************************************************************************************************************/

#include "Keyboard.h"               // keyboard(FX keys) library
#include <Keypad.h>                // This library is for interfacing with the Matrix
#include <Mouse.h>                // mouse move library
#include <SPI.h>                 // OLED
#include <Wire.h>               // OLED
#include <Adafruit_GFX.h>      // OLED
#include <Adafruit_SSD1306.h> // OLED
#include <HID-Project.h>     // encoder library
#include <SimpleDHT.h>     // include DHT


#define inputCLK 5   // Rotary Encoder Inputs on the board of the encoder
#define inputDT 6   // Rotary Encoder Inputs on the board of the encoder 
#define inputSW 7  // Rotary Encoder Inputs on the board of the encoder
#define piezo 4 // PIEZO input pin 4
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); //declaration for OLED

const byte ROWS = 3;  // 6 rows
const byte COLS = 6; // 4 columns

char keys[ROWS][COLS] = {
  {'Q', 'W', 'E', '7', '8', '9'},  // Matrix  
  {'A', 'S', 'D', '4', '5', '6'},
  {'Y', 'X', 'C', '1', '2', '3'},  // these values need to be single character...

};

byte rowPins[ROWS] = {8, 9, 10, 16, 14, 15,};    //connect to the row pinouts of the keypad to arduino
byte colPins[COLS] = {18, 19, 20};   //connect to the column pinouts of the keypad to arduino

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
  
void changeMode() {  // changing mode of the ENCODER
    mode = (mode % maxModes) + 1;
}

int currentStateCLK;
int previousStateCLK; 
int modePushCounter = 0;        // counter for the number of button presses
int buttonState = 0;           // current state of the button
int latButtonState = 0;       // previous state of the button
int mouseMove;
int mode = 1;       // modes of the ENCODER
int maxModes = 4;  // modes of the ENCODER

const int ModeButton = 7;      // the pin that the Modebutton is attached to
const int pot = A1;            // pot for adjusting attract mode demoTime or mouseMouse pixel value
//const int Mode1= A2;
//const int Mode2= A3;         //Mode status LEDs

void setup() {

  Serial.begin(9600); // set serial being to 9600 

  pinMode(piezo, OUTPUT);   // set piezo pin to output mode
  
  pinMode (inputCLK,INPUT);          // Set encoder pins as inputs  
	pinMode (inputDT,INPUT);         // Set encoder pins as inputs 
	pinMode(inputSW, INPUT_PULLUP); //Set encoder pins as input_pullup 

  note(piezo, 261, 800); //C - play it
  delay(500);
  noTone(piezo); // do not play 
   delay(500);
  note(piezo, 330, 800); //E
   delay(500);
  noTone(piezo);
  note(piezo, 392, 800); //G
   delay(500);
  noTone(piezo);
  note(piezo, 294, 800); //D
   delay(500);
  noTone(piezo);
  note(piezo, 370, 800); //F#
   delay(500);
  noTone(piezo);
  note(piezo, 440, 800); //A
   delay(500);
  noTone(piezo);

  Consumer.begin();  // encoder
 	Keyboard.begin(); // encoder
  previousStateCLK = digitalRead(inputCLK); // Assign to previousStateCLK variable // Read the initial state of inputCLK

  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3D)) { // Address 0x3D for 128x64 or 0x3C for 128x32
    Serial.println(F("SSD1306 allocation failed"));      // OLED
    for (;;); // Don't proceed, loop forever
  }
  display.clearDisplay(); //display Text
  display.setTextSize(3);
  display.setTextColor(WHITE);
  display.setCursor(0,10);
  display.print("PADys");
  display.display();
  display.setTextSize(1);
  display.setCursor(0, 55);
  display.print("Macro PAD by Jendys");
  display.display();
  delay(2000);
  display.clearDisplay();
}
void loop() {
  //ENCODER PART
	currentStateCLK = digitalRead(inputCLK);                 // Read the current state of inputCLK

	if (currentStateCLK != previousStateCLK){              // If the previous and the current state of the inputCLK are different then a pulse has occured
		
		if (digitalRead(inputDT) != currentStateCLK) {     // If the inputDT state is different than the inputCLK state then 
			rotateRight();
		} else {                                         // the encoder is rotating counterclockwise
			rotateLeft();
		}
	} 
	previousStateCLK = currentStateCLK;  // Update previousStateCLK with the current state

  if(!digitalRead(inputSW)) {        // changing mode and delay 300
    changeMode();
    delay(300);
  }
}
void changeMode(){
  mode = (mode % maxModes) + 1;
}
void rotateLRight() {  // adding thinks to modes/case RIGHT ROTATE
  switch(mode) {
    case 1:
      // Increase the volume
      display.clearDisplay();
      display.setTextSize(2);
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("VOLUME +");
      Consumer.write(MEDIA_VOLUME_UP);
      break;
    case 2: 
      // WEB - GOOGLE - Cltr + TAB
      display.clearDisplay();
      display.setTextSize(2);
      display.setTextColor(WHITE); 
      display.setCursor(0, 10);
      display.print("Tabs ->");
      Keyboard.press(KEY_LEFT_CTRL);
      Keyboard.press(KEY_TAB);
      Keyboard.releaseAll();
      break;
    case 3:
      // Scroling
      display.clearDisplay();
      display.setTextSize(2);
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("Arrow Down");
      Keyboard.write(KEY_UP_ARROW);
      break;
    case 4:
      // Brush size
      display.clearDisplay();
      display.setTextSize(2);
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("Size +");
      Keyboard.press('[ ');
      break;
  }
}
void rotateLeft() {     // adding thinks to modes/case LEFT ROTATE
  switch(mode) {
    case 1:
      // Decrease the volume
      display.clearDisplay();
      display.setTextSize(2);
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("VOLUME -");
      Consumer.write(MEDIA_VOLUME_DOWN);
      break;
    case 2: 
      //Cltr + SHIFT + TAB
      display.clearDisplay();
      display.setTextSize(2));
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("Tabs <-");
      Keyboard.press(KEY_LEFT_CTRL);
      Keyboard.press(KEY_LEFT_SHIFT);
      Keyboard.press(KEY_TAB);
      Keyboard.releaseAll();
      break;
    case 3:
      // Scroling
      display.clearDisplay();
      display.setTextSize(3);
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("Arrow Up");
      Keyboard.press(KEY_DOWN_ARROW);
      break;
    case 4:
      // Brush size
      display.clearDisplay();
      display.setTextSize(3);
      display.setTextColor(WHITE);
      display.setCursor(0, 10);
      display.print("Size - ");
      Keyboard.press(']');
      break;
  }
}
  // Keypad/MATRIX/Switches part
  char key = keypad.getKey();
  mouseMove = (analogRead(pot)); //reading the analog input, pot = pin A1
  mouseMove = map(mouseMove, 0,1023, 1,124); //remap the analog pot values fron 1 to 124
  checkModeButton();

    switch (modePushCounter) {                 // switch between keyboard configurations:
    case 0:                                   //Application Alpha or MODE 0. Example = Every button ends your Zoom call
       if (key) {
    Serial.println(key);
    switch (key) {
      case '1':
      KeyBoard.press(KEY_CONTROL);
      KeyBoard.press(KEY_NUM1); 
      KeyBoard.releaseAll();
      break;
      case '2':
      KeyBoard.press(KEY_CONTROL);
      KeyBoard.press(KEY_NUM2); 
      KeyBoard.releaseAll();
      break;
      case '3':
      KeyBoard.press(KEY_CONTROL);
      KeyBoard.press(KEY_NUM3); 
      KeyBoard.releaseAll(); 
      break;
      case '4':
      KeyBoard.press(KEY_CONTROL);
      KeyBoard.press(KEY_NUM1); 
      KeyBoard.releaseAll(); 
      break;
      case '5':
      KeyBoard.press(KEY_CONTROL);
      KeyBoard.press(KEY_NUM1); 
      KeyBoard.releaseAll(); 
      break;
      case '6':
      KeyBoard.press(KEY_CONTROL);
      KeyBoard.press(KEY_NUM1); 
      KeyBoard.releaseAll();
      break;
      case '7':


      break;
      case '8'


      break;
      case '9':


      break;
      case 'Q':


      break;
      case 'W':


      break;
      case 'E':


      break;
      case 'A':


      break;
      case 'S':


      break;
      case 'D': 


      break;
      case 'Y': 


      break;
      case 'X':


      break;
      case 'C': 


      break;
     }
     delay(100);
     Keyboard.releaseAll();  // this releases the buttons 
  }
      break;
}

This is the code it isn't done yet but I was thinking about trying some parts of the code bur it wast working please help me.

Similar Issue for me:
In file included from c:\users\joosl\documents\arduino\libraries\hid-project\src\hid-apis\KeyboardAPI.h:29:0,
from c:\users\joosl\documents\arduino\libraries\hid-project\src\hid-apis\defaultkeyboardapi.h:27,
from C:\Users\Joosl\Documents\Arduino\libraries\HID-Project\src/SingleReport/BootKeyboard.h:30,
from C:\Users\Joosl\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:50,
from C:\Users\Joosl\Documents\Arduino\Projects\Macropad\Macropad.ino:4:
c:\users\joosl\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"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\users\joosl\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:73:25: error: expected identifier before '=' token
KEY_H = 11,
^
c:\users\joosl\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:73:25: error: expected '}' before '=' token
c:\users\joosl\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:73:25: error: expected unqualified-id before '=' token
c:\users\joosl\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:521:1: error: expected declaration before '}' token
};
^

exit status 1

Compilation error: exit status 1

I checked the file from HID Project itself, but it was just a listing of the different characters. In this case, it was H, where it randomly expected something else than in every other line

And what does that mean :smiley:
I guess that dont solve oure problem

I guess that's right, I didn't want to create another topic that's so similar.
But, for me, i actually found a solution: I copied my code to the Arduino web ide, and tried to load it onto my Arduino from there. There aren't as many errors, and it loads onto the Arduino perfectly fine. Maybe it works out for you as well

If there are syntax errors in the code then it will not compile so will not upload to the Arduino

Oh nice i Will try it thx.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.