I have a Digispark Rev 3 clone, and I can't seem to upload my sketch because everytime it comes up with the error message; fatal error:
In file included from C:\Users\user\Documents\Arduino\test\test.ino:1:0:
C:\Program Files (x86)\Arduino\libraries\Keyboard\src/Keyboard.h:25:17: fatal error: HID.h: No such file or directory #include "HID.h"
^
compilation terminated.
exit status 1
Error compiling for board Digispark (Default - 16.5mhz).
Everything was working before, but now it has just stopped working, and I have no idea why.
I am using the Digistump AVR board
I've tried:
Reinstalling Arduino IDE (+ deleting the Arduino 15 file)
Downloading the Github USBHost library (Unless I did it wrong)
Updating and downgrading the Keyboard library
I really don't know what to do; I've spent 3 hours trying to fix it.
Does the file HID.h exist at the given location? Note that includes might be case sensitive on Windows systems, not sure; so if you do find e.g Hid.h, it might be the cause.
Note to others: the Digispark possibly has a software USB emulation. Please note that OP said that it worked before.
#include "DigiKeyboard.h"
void setup() {
// don't need to set anything up to use DigiKeyboard
}
void loop() {
// this is generally not necessary but with some older systems it seems to
// prevent missing the first character after a delay:
DigiKeyboard.sendKeyStroke(0);
// Type out this string letter by letter on the computer (assumes US-style
// keyboard)
DigiKeyboard.println("Hello Digispark!");
// It's better to use DigiKeyboard.delay() over the regular Arduino delay()
// if doing keyboard stuff because it keeps talking to the computer to make
// sure the computer knows the keyboard is alive and connected
DigiKeyboard.delay(5000);
}