Skip to main content
added 177 characters in body
Source Link
Greenonline
  • 3.2k
  • 7
  • 37
  • 49

If you have Arduino/Genuino Uno selected as your board in the Tools ► Board ► menu, then you get the error. If you select Arduino Leonardo it compiles correctly.

From Can't seem to be able use Keyboard.h library, this post states:

Keyboard.h (and Mouse.h) only works on devices that use the ATmega32u4 processor, like the Leonardo or Micro. See: https://www.arduino.cc/en/Reference/MouseKeyboard

This solution might help though

I had the same problem using Flora

This worked for me:

  1. Tools > Boards > Boards Manager
  2. Install TeeOnArdu (Then select that board from Boards Manager)
  3. Tools > USB Type > Serial, Keyboard, Mouse < Joypad
  4. Upload and run code again (might need to restart IDE)

From Can't seem to be able use Keyboard.h library, this post states:

Keyboard.h (and Mouse.h) only works on devices that use the ATmega32u4 processor, like the Leonardo or Micro. See: https://www.arduino.cc/en/Reference/MouseKeyboard

This solution might help though

I had the same problem using Flora

This worked for me:

  1. Tools > Boards > Boards Manager
  2. Install TeeOnArdu (Then select that board from Boards Manager)
  3. Tools > USB Type > Serial, Keyboard, Mouse < Joypad
  4. Upload and run code again (might need to restart IDE)

If you have Arduino/Genuino Uno selected as your board in the Tools ► Board ► menu, then you get the error. If you select Arduino Leonardo it compiles correctly.

From Can't seem to be able use Keyboard.h library, this post states:

Keyboard.h (and Mouse.h) only works on devices that use the ATmega32u4 processor, like the Leonardo or Micro. See: https://www.arduino.cc/en/Reference/MouseKeyboard

This solution might help though

I had the same problem using Flora

This worked for me:

  1. Tools > Boards > Boards Manager
  2. Install TeeOnArdu (Then select that board from Boards Manager)
  3. Tools > USB Type > Serial, Keyboard, Mouse < Joypad
  4. Upload and run code again (might need to restart IDE)
Source Link
Greenonline
  • 3.2k
  • 7
  • 37
  • 49

From Can't seem to be able use Keyboard.h library, this post states:

Keyboard.h (and Mouse.h) only works on devices that use the ATmega32u4 processor, like the Leonardo or Micro. See: https://www.arduino.cc/en/Reference/MouseKeyboard

This solution might help though

I had the same problem using Flora

This worked for me:

  1. Tools > Boards > Boards Manager
  2. Install TeeOnArdu (Then select that board from Boards Manager)
  3. Tools > USB Type > Serial, Keyboard, Mouse < Joypad
  4. Upload and run code again (might need to restart IDE)