#include "HID.h"

Hello,

I’m newish do the Arduino and have gotten really close to getting my arduino ATmega32U4 5V/16MHz set up as the brain’s for a 3D Illuminated Arcade Spinner. I figured out how to add the board using these instructions, troubleshooted a cable issue by reading the previous issues of this form, & added the adafruit Neil pixel library. So Think it’s okay for me to now ask for help now.

I added the two different libraries that came up with the search for “HID.h” but I keep getting the below error message when checking the sketch.

Any help appreciated.

Illuminated_Arcade_Spinner/files/ToSpin_20/ToSpin_20.ino:4:0:
/Applications/Arduino.app/Contents/Java/libraries/Mouse/src/Mouse.h:25:17: fatal error:: No such file or directory
#include “HID.h”
^
compilation terminated.
exit status 1
Error compiling for board Cosa Arduino Pro Micro (ATmega32U4/Caterina).

Below is a screen shoot

The problem is you’re using Cosa which, unlike Arduino AVR Boards, doesn’t include an HID library. Is it necessary for you to use Cosa? If not then just choose Tools > Board > Arduino/Genuino Micro and the problem will go away. If it is necessary for you to use Cosa then I can think of a couple possible solutions but haven’t tried any because I don’t use Cosa:

First possible solution:
Delete the line:

#include <Mouse.h>

from your sketch. Cosa may be based on the older versions of the Arduino IDE, which had the Mouse functions built into the core and thus did not require this to access the Mouse functions.

Second possible solution:
Copy the HID library from the libraries folder of the Arduino AVR Boards package to the libraries folder of the Cosa package.

pert:
The problem is you’re using Cosa which, unlike Arduino AVR Boards, doesn’t include an HID library. Is it necessary for you to use Cosa? If not then just choose Tools > Board > Arduino/Genuino Micro and the problem will go away. If it is necessary for you to use Cosa then I can think of a couple possible solutions but haven’t tried any because I don’t use Cosa:

First possible solution:
Delete the line:

#include <Mouse.h>

from your sketch. Cosa may be based on the older versions of the Arduino IDE, which had the Mouse functions built into the core and thus did not require this to access the Mouse functions.

Second possible solution:
Copy the HID library from the libraries folder of the Arduino AVR Boards package to the libraries folder of the Cosa package.

It’s looking good. It uploaded, but I need to assemble and test to be sure. Thank you so much for your help!

Glad if I can help. If you end up verifying a solution to the issue please give us an update as it may be helpful to others who run into the same issue and find this in their search.