Bluefruit keyboard error - HID.h: No such file or directory

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mbmosher
 
Posts: 37
Joined: Tue Jan 26, 2010 2:08 pm

Bluefruit keyboard error - HID.h: No such file or directory

Post by mbmosher »

Hi folks,
I'm am trying to use the Circuit Playground Bluefruit with the native Keyboard.h library. However, when trying to compile the code for the Circuit Playground Bluefruit I get the following error:

Code: Select all

Arduino: 1.8.19 (Mac OS X), Board: "Adafruit Circuit Playground Bluefruit, S140 6.1.1, Level 0 (Release), Serial"

Multiple libraries were found for "Keyboard.h"
 Used: /Users/matt/Documents/Arduino/libraries/Keyboard
 Not used: /Applications/Arduino.app/Contents/Java/libraries/Keyboard
In file included from /Users/matt/Documents/Arduino/3602KeyboardDemo/3602KeyboardDemo.ino:1:
/Users/matt/Documents/Arduino/libraries/Keyboard/src/Keyboard.h:25:10: fatal error: HID.h: No such file or directory
   25 | #include "HID.h"
      |          ^~~~~~~
compilation terminated.
exit status 1
Error compiling for board Adafruit Circuit Playground Bluefruit.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The simplest code I can use to generate this error is:

Code: Select all

#include <KeyboardLayout.h>
#include <Keyboard.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}
Using OSX 10.14.6 and Arduino 1.8.19 and Keyboard Library 1.0.3. Had the same problem on our windows machines in the computer lab. Any suggestions? Same code works fine on the Circuit Playground Express.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluefruit keyboard error - HID.h: No such file or direct

Post by mikeysklar »

Did you try the blehid_keyboard.ino example? It does not use keyboard.h / hid.h headers.

https://github.com/adafruit/Adafruit_nR ... yboard.ino

User avatar
mbmosher
 
Posts: 37
Joined: Tue Jan 26, 2010 2:08 pm

Re: Bluefruit keyboard error - HID.h: No such file or direct

Post by mbmosher »

Yes, the BLEHID functions fine over bluetooth. I am trying to use Keyboard.h with the Circuit Playground Bluefruit as a wired keyboard device over USB cable.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluefruit keyboard error - HID.h: No such file or direct

Post by mikeysklar »

Gotcha. I suspect you might need to use a non-native keyboard.h with the nRF52 boards for wired HID devices.

Give the Adafruit_TinyUSB_Arduino example a try. It specifically calls out support for the nRF52 BLE CPX you are using.

https://github.com/adafruit/Adafruit_Ti ... yboard.ino

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”