File -> examples -> usb -> keyboard -> KeyboardMessage [not work this example]

Hi, my name is Alex from Brazil.

I have a dificult with for use anyone example usb -> keyboard -> KeyboardMessage

When loaded the example KeyboardMessage and do it a code test from IDE of the Arduino there is a error.

When you encounter an error you will see a button on the right side of the orange bar “Copy error messages”. Click that button and then paste it in a message here USING CODE TAGS(</> button on the toolbar).

FYI, you can only use that example with the ATmega32U4 based boards such as Leonardo and Micro.

Arduino: 1.6.13 (Linux), Board: “Arduino/Genuino Uno”

In file included from /tmp/arduino_modified_sketch_998993/sketch_dec01a.ino:1:0:
/home/alex/Arduino/libraries/Keyboard/src/Keyboard.h:29:2: warning: #warning “Using legacy HID core (non pluggable)” [-Wcpp]
#warning “Using legacy HID core (non pluggable)”
^
/tmp/arduino_modified_sketch_998993/sketch_dec01a.ino: In function ‘void hitEnter()’:
sketch_dec01a:39: error: ‘Keyboard’ not found. Does your sketch include the line ‘#include <Keyboard.h>’?
Keyboard.releaseAll();
^
/tmp/arduino_modified_sketch_998993/sketch_dec01a.ino: In function ‘void sendCommand(String)’:
sketch_dec01a:46: error: ‘Keyboard’ not found. Does your sketch include the line ‘#include <Keyboard.h>’?
Keyboard.releaseAll();
^
/tmp/arduino_modified_sketch_998993/sketch_dec01a.ino: In function ‘void openAdminCMD()’:
sketch_dec01a:66: error: ‘Keyboard’ not found. Does your sketch include the line ‘#include <Keyboard.h>’?
Keyboard.releaseAll();
^
sketch_dec01a:67: error: ‘KEY_LEFT_GUI’ was not declared in this scope
Keyboard.press(KEY_LEFT_GUI); //
^
sketch_dec01a:80: error: ‘KEY_LEFT_ARROW’ was not declared in this scope
Multiple libraries were found for “Keyboard.h”
Used: /home/alex/Arduino/libraries/Keyboard
Not used: /home/alex/livre/arduino-1.6.13/libraries/Keyboard
Keyboard.press(KEY_LEFT_ARROW); //
^
/tmp/arduino_modified_sketch_998993/sketch_dec01a.ino: In function ‘void setup()’:
sketch_dec01a:113: 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>’?

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

You can't use the Keyboard or Mouse functions with the Uno board. They are only supported by the ATmega32U4 based boards.

Also, you forgot to use code tags.

This is it!

My ATMEGA is 328P-PU.

I understand.

Thank you.

Hi all.
I have the same problem but I don´t understand where is the problem.
In Arduino reference I can read:
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.

I´ve got two ARDUINO Due and the chip are Atmel 328P-PU also.

Perhabs there is a mistake in the reference?

Thank you in advanced.

AndyTheGreyFox:
I´ve got two ARDUINO Due and the chip are Atmel 328P-PU also.

Perhabs there is a mistake in the reference?

If they have an ATmega328P then they're not Dues and they won't work with the Keyboard library.