Skip to main content
3 of 3
edited tags; edited title
Juraj
  • 18.3k
  • 4
  • 32
  • 50

Arduino Uno "Keyboard Not Found"

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>'?
   Keyboard.begin();
   ^
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)
{
  Keyboard.press(key);
  delay(50);
  Keyboard.release(key);
}

void setup()
{
  // Begining the Keyboard stream
  Keyboard.begin();

  // Wait 500ms
  delay(500);

  delay(400);

  Keyboard.print("Hello World!");

  // Ending stream
  Keyboard.end();
}

void loop() {}

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

Katz
  • 129
  • 1
  • 1
  • 8