"HID.h: No such file or directory" with arduino leonardo

I've tried everything.

Arduino: 1.8.19 (Windows 10), Board: "Arduino Leonardo"

In file included from C:\Users\███\Desktop\███\███.ino:1:0:

C:\Users\███\Documents\Arduino\libraries\Mouse\src/Mouse.h:25:10: fatal error: HID.h: No such file or directory

#include "HID.h"

      ^~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Leonardo.

Try installing the library in your library directory.

Ive tried installing the libary, and it does not work.

it also says on the github page:

The USBHost library allows an Arduino Due board to appear as a USB host...

The library HID.h is a part of AVR-core Arduino libraries, you don't need to install it directly, it should be installed with Arduino IDE.
The folder HID should be located in \hardware\arduino\avr\libraries\ in your IDE install dir.

I have the same issue, but I cant find the root folder library? is it realy in the folder of the arduino?

What arduino board do you use?

I didnt use an arduino board that could be the problem. So I bought an arduino with ATmega32u4 then it works. i used the UART to communicate but I got stuck because it didnt communicate. The solution was to use Serial1 not Serial to recieve data from an other board.

Thank you for your reply

Hello! just a little follow-up. After removing the IDE from my computer and reinstalling an older version of the old one, everything worked. hope this helps someone.

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