Wątek przeniesiony 2021-05-03 19:00 z Inne języki programowania przez Ktos.

Arduino błąd z #include<Keyboard.h>

0

Nie wiem jak naprawić błąd o komunikacje:

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Uno"
In file included from xd.ino:1:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\Keyboard\src/Keyboard.h:29:2: warning: #warning "Using legacy HID core (non pluggable)" [-Wcpp]

 #warning "Using legacy HID core (non pluggable)"

xd.ino: In function 'void setup()':

NWM:8:1: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

 Keyboard.begin();

 ^~~~~~~~

NWM:10:16: error: 'KEY_LEFT_GUI' was not declared in this scope

 Keyboard.press(KEY_LEFT_GUI);

                ^~~~~~~~~~~~

NWM:16:16: error: 'KEY_RETURN' was not declared in this scope

 Keyboard.press(KEY_RETURN);

                ^~~~~~~~~~

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.

Dziękuje z góry

0

Najbardziej oczywiste: czy na górze swojego pliku .ino masz #include <Keyboard.h>?

Drugie najbardziej oczywiste: masz zaznaczoną płytkę Arduino Leonardo (i używasz Leonardo albo Pro Micro)? Z tego co kojarzę standardowa biblioteka Keyboard chyba nie działa na niczym innym.

1 użytkowników online, w tym zalogowanych: 0, gości: 1