This is my first script written with Arduino. I wrote a simple Hello World program but I'm getting the following error.

Test:18: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
exit status 1
'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

Here is the code:

#include "Keyboard.h"

void typeKey(int key)

void setup()
  // Begining the Keyboard stream

  // Wait 500ms


  Keyboard.print("Hello World!");

  // Ending stream

void loop() {}

I have Arduino/Genuino UNO selected as my board on the IDE. Any suggestions on how I can fix this? Thanks

  • Are there tutorials with the same board? Have you tried code that is verified to be working on other boards (from other tutorials)?
    – aaa
    Nov 17, 2016 at 16:59

1 Answer 1


Based on the documentation :

These core libraries allow a 32u4 based boards or Due and Zero board to appear as a native Mouse and/or Keyboard to a connected computer.

Core libraries (such as Keyboard.h) are not availabe if your board doesn't mentioned.

I don't know which one is right, since your question title mentioned "Arduino Micro" while at the end of your question, the board is "Arduino Uno".

Just for further information, Arduino Uno is based on - ATmega328P, and Arduino Micro is based on - ATmega32U4. So sure, that "hello world" program will works on Arduino Micro, but not on Arduino Uno.

  • On the Arduino Get Started Page it says for the Arduino Micro in order to program it I need to select Arduino/Genuino UNO as my board thats why I added it at the end. My actual device is the Arduino Micro
    – Katz
    Nov 17, 2016 at 2:22
  • 1
    Well, how about look at this "Get Started Page" instead : arduino.cc/en/Guide/ArduinoLeonardoMicro go to Select your board parts, and have fun
    – duck
    Nov 17, 2016 at 2:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.