Error compiling for digispark board (default- 16.5mhz

I am very new to the arduino scene, and am trying to create a rickroll for the attiny85 usb, I am trying to create something simple yet fast. I have tried many things but am running into many issues, the most prominent one being, Error compiling for board Digispark (Default - 16.5mhz).

In file included from C:\Users\Gaston Boucher\Documents\Arduino\Keyboard\sketch_sep26b\sketch_sep26b.ino:1:0:
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.51.0_x86__mdqgnx93n4wtt\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).

and my code is this (i have tried for hours to get something that works but it always needs to install the driver on my test laptop it doesn't bypass that and just run the script)

#include "Keyboard.h"

void setup() {









Keyboard.print("start Rick Astley - Never Gonna Give You Up (Official Music Video) - YouTube");









Keyboard.print("You've been Rick Rolled");


//It's for shutdown the computer//;'x');



//c'est fini akhy//



it would also be great if you could provide a script for doing this (so I can work backwards and figure out how to use the code) and a full detailed list of instructions on how to set up my Arduino ide. I have worked with Arduinos for a total of an hour est so please try to keep it basic.

Please follow the advice given in the link below when posting code. Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

So your error message states that

#include "HID.h"

This file does not exist (or it can't find it) and it is included in

#include "Keyboard.h"

If you do know where that file is, you should put it in the save folder as keyboard.h
Or you might be able to just include it in your sketch so the compiler can find it.

Can you use Keyboard.h with that chip ?
From Keyboard - Arduino Reference

These core libraries allow the 32u4 and SAMD based boards (Leonardo, Esplora, Zero, Due and MKR Family) to appear as a native Mouse and/or Keyboard to a connected computer.

The Digispark board uses a different library for keyboard emulation. It is named "DigisparkKeyboard. You can find a demonstration of how to use it in the Arduino IDE at File > Examples > DigisparkKeyboard > Keyboard

1 Like

You had better install the library first :slight_smile: or there won't be any example files available

DigisparkKeyboard is a platform bundled library. It is installed along with the boards platform that adds support to the Arduino IDE for the Digispark. So gastatouille already has it installed.

Something to note about platform bundled libraries: they are only accessible when you have a board of that platform selected from the Arduino IDE's Tools > Board menu. So you won't find the example if you have some other platform's board (e.g., Arduino Uno) selected.

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