Issues with arduino libraries

D:\DESCARGAS.arduinoIDE\everyCharacter\everyCharacter.ino:1:22: fatal error: Keyboard.h: No such file or directory
#include "Keyboard.h"
^
compilation terminated.

exit status 1

Compilation error: Keyboard.h: No such file or directory

Hi guys when I tried to run my code in arduino I had this problem. Could anyone help me?

Hi @mary4434. Which version of Arduino IDE are you using (e.g., "2.0.3")? The version number is shown on the title bar of the Arduino IDE window and also in the Help > About dialog.

Which Arduino are you compiling for ?
The Keyboard library will only work with certain processors, not an Atmega328 as used on a Uno or Nano, for example

I am using attinity 85 I mean the digispark card.

Version: 2.0.2
Date: 2022-11-17T11:54:56.612Z
CLI Version: 0.29.0 [76251df9]

Copyright © 2022 Arduino SA
This one.

Then it is incompatible with the Keyboard library

See Keyboard - Arduino Reference

As explained, the Keyboard library can't be used with that board. For the DigiSpark, you can use the "DigisparkKeyboard" library that comes as part of the "Digistump AVR Boards" platform you install to add support to Arduino IDE for the Digispak board.

To use that library, change the #include directive in your sketch to:

#include "DigiKeyboard.h"

But even though it cannot be used for your current project, maybe you will eventually want to use the "Keyboard" library with a board it is compatible with, such as the Arduino Leonardo, or maybe it will be useful to learn how to install libraries in general, so I'll provide instructions for installing the Keyboard library:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. In the "Filter your search" field, type keyboard
  3. Scroll down through the list of libraries until you see the "Keyboard by Arduino" entry.
  4. You will see an "INSTALL" button at the bottom of the entry. Click the button.
  5. Wait for the installation to finish.

okey and which code do you recommend for do this exercise with this digispark?


This works now but my problem is when I try to put a code for capture random keystrokes each time that you press a keystroke.

So,I´ll apreciate if you can share with me with this conditions that works in digispark card. Thanks again!

That is off topic for this discussion. You will have better results if you create a new forum topic in the appropriate forum category to get help with that.

The best way to do this is to first make your best effort to do some research on the subject, and ideally to attempt to writing the code yourself. Then when you create the new topic, provide a detailed description of what you already tried and what problems you encountered, along with the full text of any code you wrote. That will give a good starting point for the helpers.

okey thanks I am going to put some codes that I did.

Please don't post pictures of code and output. Copy them and post them here in code tags

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

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