Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?" #11

Open
jareddo-kun opened this issue Oct 13, 2020 · 1 comment

Comments

@jareddo-kun
Copy link

jareddo-kun commented Oct 13, 2020

Soooo, been experiencing this now
Here's the error message

`
Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

D:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries C:\Users\jaredo-kun\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156 -warnings=none -build-cache C:\Users\JAREDO1\AppData\Local\Temp\arduino_cache_753850 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=D:\Arduino\hardware\tools\avr -verbose D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino

D:\Arduino\arduino-builder -compile -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries C:\Users\jaredo-kun\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156 -warnings=none -build-cache C:\Users\JAREDO1\AppData\Local\Temp\arduino_cache_753850 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=D:\Arduino\hardware\tools\avr -verbose D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino

Using board 'uno' from platform in folder: D:\Arduino\hardware\arduino\avr

Using core 'arduino' from platform in folder: D:\Arduino\hardware\arduino\avr

Detecting libraries used...

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for Keyboard.h: [[email protected]]

ResolveLibrary(Keyboard.h)

-> candidates: [[email protected]]

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for HID.h: [[email protected]]

ResolveLibrary(HID.h)

-> candidates: [[email protected]]

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Using cached library dependencies for file: C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\CapacitiveSensor.cpp

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "D:\Arduino\libraries\Keyboard\src\Keyboard.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "D:\Arduino\hardware\arduino\avr\libraries\HID\src\HID.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\preproc\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"D:\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

Using previously compiled file: C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\CapacitiveSensor.cpp.o

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp.o"

In file included from D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino:6:0:

C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\capacitiveKey.h: In member function 'void CapacitiveKey::keyUpdate(bool)':

C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\capacitiveKey.h:27:31: error: 'Keyboard' was not declared in this scope

       if (keyboardActive) Keyboard.press(key);

                           ^~~~~~~~

C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\capacitiveKey.h:36:13: error: 'Keyboard' was not declared in this scope

         Keyboard.release(key);

         ^~~~~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino: In function 'void setup()':

KappaPad:15:3: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

Keyboard.begin();

^~~~~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\CapacitiveSensorSketch.ino: In function 'void setup()':

CapacitiveSensorSketch:16:6: error: redefinition of 'void setup()'

void setup()

  ^~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino:11:6: note: 'void setup()' previously defined here

void setup() {

  ^~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\CapacitiveSensorSketch.ino: In function 'void loop()':

CapacitiveSensorSketch:22:6: error: redefinition of 'void loop()'

void loop()

  ^~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino:36:6: note: 'void loop()' previously defined here

void loop() {

  ^~~~

Using library Keyboard at version 1.0.2 in folder: D:\Arduino\libraries\Keyboard

Using library HID at version 1.0 in folder: D:\Arduino\hardware\arduino\avr\libraries\HID

exit status 1

'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

`

ccc

@EXtremeExploit
Copy link

EXtremeExploit commented Oct 13, 2020

The Keyboard header file does not exists in the arduino uno board, you would need to use the leonardo or leonardo mini, since the leonardo variants have the USB keyboard implemented in the board itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants