Getting an error when i try to verify code

Am new to this, I have a pro micro and am trying to make a button box.
when i verify the code this error comes up. I'm in over my head and some clarification on what the issue is would be great. thanks in advance.

Arduino: 1.8.20 Hourly Build 2022/04/25 09:33 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"

C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware -hardware C:\Users\shane's pc\AppData\Local\Arduino15\packages -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\tools-builder -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware\tools\avr -tools C:\Users\shane's pc\AppData\Local\Arduino15\packages -built-in-libraries C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\libraries -libraries C:\Users\shane's pc\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -vid-pid=2341_8036 -ide-version=10820 -build-path C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072 -warnings=none -build-cache C:\Users\SHANE'~1\AppData\Local\Temp\arduino_cache_558706 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avrdude.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\shane's pc\Downloads\wim_s_button_box_code\wim_s_button_box_code.ino

C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\arduino-builder -compile -logger=machine -hardware C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware -hardware C:\Users\shane's pc\AppData\Local\Arduino15\packages -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\tools-builder -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware\tools\avr -tools C:\Users\shane's pc\AppData\Local\Arduino15\packages -built-in-libraries C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\libraries -libraries C:\Users\shane's pc\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -vid-pid=2341_8036 -ide-version=10820 -build-path C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072 -warnings=none -build-cache C:\Users\SHANE'~1\AppData\Local\Temp\arduino_cache_558706 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avrdude.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\shane's pc\Downloads\wim_s_button_box_code\wim_s_button_box_code.ino

Using board 'pro' from platform in folder: C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

Using core 'arduino' from platform in folder: C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

Detecting libraries used...

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072\sketch\wim_s_button_box_code.ino.cpp" -o nul

Alternatives for Keypad.h: [Keypad@3.1.0]

ResolveLibrary(Keypad.h)

-> candidates: [Keypad@3.1.0]

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072\sketch\wim_s_button_box_code.ino.cpp" -o nul

Alternatives for Joystick.h: [ArduinoJoystickLibrary-master@2.1.1]

ResolveLibrary(Joystick.h)

-> candidates: [ArduinoJoystickLibrary-master@2.1.1]

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072\sketch\wim_s_button_box_code.ino.cpp" -o nul

Error while detecting libraries included by C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072\sketch\wim_s_button_box_code.ino.cpp

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src\Key.cpp" -o nul

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src\Keypad.cpp" -o nul

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src\DynamicHID\DynamicHID.cpp" -o nul

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src\Joystick.cpp" -o nul

Error while detecting libraries included by C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src\Joystick.cpp

Generating function prototypes...

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=10820 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072\sketch\wim_s_button_box_code.ino.cpp" -o "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_661072\preproc\ctags_target_for_gcc_minus_e.cpp"

In file included from C:\Users\shane's pc\Downloads\wim_s_button_box_code\wim_s_button_box_code.ino:2:0:

C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src/Joystick.h:32:2: error: #error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).

#error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).

^~~~~

Using library Keypad at version 3.1.0 in folder: C:\Users\shane's pc\Documents\Arduino\libraries\Keypad

Using library ArduinoJoystickLibrary-master at version 2.1.1 in folder: C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master

exit status 1

Error compiling for board Arduino Pro or Pro Mini.

You wrote that you have Pro micro, but selected Pro Mini when verified your code. What board do you use actually?

Library Joystick is not suited for Pro mini.

i have a pro micro. the list of borads in the tools tab said Arduino pro or pro mini. it does not have Arduino pro micro. i thought Arduino pro meant the micro, i assume I'm wrong?

If Leonardo in the list - select it

Selected it. now have this error

Arduino: 1.8.20 Hourly Build 2022/04/25 09:33 (Windows 10), Board: "Arduino Leonardo"

C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware -hardware C:\Users\shane's pc\AppData\Local\Arduino15\packages -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\tools-builder -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware\tools\avr -tools C:\Users\shane's pc\AppData\Local\Arduino15\packages -built-in-libraries C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\libraries -libraries C:\Users\shane's pc\Documents\Arduino\libraries -fqbn=arduino:avr:leonardo -vid-pid=2341_8036 -ide-version=10820 -build-path C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978 -warnings=none -build-cache C:\Users\SHANE'~1\AppData\Local\Temp\arduino_cache_958222 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\shane's pc\Downloads\wim_s_button_box_code1\wim_s_button_box_code1.ino

C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\arduino-builder -compile -logger=machine -hardware C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware -hardware C:\Users\shane's pc\AppData\Local\Arduino15\packages -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\tools-builder -tools C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\hardware\tools\avr -tools C:\Users\shane's pc\AppData\Local\Arduino15\packages -built-in-libraries C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\libraries -libraries C:\Users\shane's pc\Documents\Arduino\libraries -fqbn=arduino:avr:leonardo -vid-pid=2341_8036 -ide-version=10820 -build-path C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978 -warnings=none -build-cache C:\Users\SHANE'~1\AppData\Local\Temp\arduino_cache_958222 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\shane's pc\Downloads\wim_s_button_box_code1\wim_s_button_box_code1.ino

Using board 'leonardo' from platform in folder: C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

Using core 'arduino' from platform in folder: C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

Detecting libraries used...

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=atmega32u4 -DF_CPU=16000000L -DARDUINO=10820 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER="Unknown"" "-DUSB_PRODUCT="Arduino Leonardo"" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\leonardo" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp" -o nul

Alternatives for Keypad.h: [Keypad@3.1.0]

ResolveLibrary(Keypad.h)

-> candidates: [Keypad@3.1.0]

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=atmega32u4 -DF_CPU=16000000L -DARDUINO=10820 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER="Unknown"" "-DUSB_PRODUCT="Arduino Leonardo"" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\leonardo" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp" -o nul

Alternatives for Joystick.h: [ArduinoJoystickLibrary-master@2.1.1]

ResolveLibrary(Joystick.h)

-> candidates: [ArduinoJoystickLibrary-master@2.1.1]

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=atmega32u4 -DF_CPU=16000000L -DARDUINO=10820 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER="Unknown"" "-DUSB_PRODUCT="Arduino Leonardo"" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\leonardo" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp" -o nul

Using cached library dependencies for file: C:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src\Key.cpp

Using cached library dependencies for file: C:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src\Keypad.cpp

Using cached library dependencies for file: C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src\DynamicHID\DynamicHID.cpp

Using cached library dependencies for file: C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src\Joystick.cpp

Generating function prototypes...

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=atmega32u4 -DF_CPU=16000000L -DARDUINO=10820 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER="Unknown"" "-DUSB_PRODUCT="Arduino Leonardo"" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\leonardo" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp" -o "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Users\shane's pc\Downloads\arduino-nightly-windows\arduino-nightly\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/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=atmega32u4 -DF_CPU=16000000L -DARDUINO=10820 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER="Unknown"" "-DUSB_PRODUCT="Arduino Leonardo"" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino" "-IC:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\variants\leonardo" "-IC:\Users\shane's pc\Documents\Arduino\libraries\Keypad\src" "-IC:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master\src" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp" -o "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp.o"

Compiling libraries...

Compiling library "Keypad"

Using previously compiled file: C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\Keypad\Key.cpp.o

Using previously compiled file: C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\Keypad\Keypad.cpp.o

Compiling library "ArduinoJoystickLibrary-master"

Using previously compiled file: C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\ArduinoJoystickLibrary-master\Joystick.cpp.o

Using previously compiled file: C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\ArduinoJoystickLibrary-master\DynamicHID\DynamicHID.cpp.o

Compiling core...

Using precompiled core: C:\Users\SHANE'~1\AppData\Local\Temp\arduino_cache_958222\core\core_arduino_avr_leonardo_c8ce34c663e19d01c49ea5ee96eb552e.a

Linking everything together...

"C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega32u4 -o "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978/wim_s_button_box_code1.ino.elf" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\sketch\wim_s_button_box_code1.ino.cpp.o" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\Keypad\Key.cpp.o" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\Keypad\Keypad.cpp.o" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\ArduinoJoystickLibrary-master\Joystick.cpp.o" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978\libraries\ArduinoJoystickLibrary-master\DynamicHID\DynamicHID.cpp.o" "C:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978/..\arduino_cache_958222\core\core_arduino_avr_leonardo_c8ce34c663e19d01c49ea5ee96eb552e.a" "-LC:\Users\SHANE'~1\AppData\Local\Temp\arduino_build_663978" -lm

C:\Users\SHANE'~1\AppData\Local\Temp\ccJo0WB9.ltrans0.ltrans.o: In function `main':

C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Users\shane's pc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

Using library Keypad at version 3.1.0 in folder: C:\Users\shane's pc\Documents\Arduino\libraries\Keypad

Using library ArduinoJoystickLibrary-master at version 2.1.1 in folder: C:\Users\shane's pc\Documents\Arduino\libraries\ArduinoJoystickLibrary-master

exit status 1

Error compiling for board Arduino Leonardo.

Compiler says that there are no setup() and loop() in your sketch.
Please show your code.

#include <Keypad.h>
#include <Joystick.h>

//DEFINITIONS
#define ENABLE_PULLUPS
#define NUMROTARIES 3 //replace "?" with number of rotary encoders you are using
#define NUMBUTTONS 26 //replace "?"with number of buttong you are using
#define NUMROWS 4 //replace "?" with number of rows you have
#define NUMCOLS 7 //replace "?" with number of columns you have

//BUTTON MATRIX
//first change number of rows and columns to match your button matrix, 
//then replace all "?" with numbers (starting from 0)
byte buttons[NUMROWS][NUMCOLS] = {
  {0,1,2,3,4,5,6},
  {7,8,9,10,11,12,13},
  {14,15,16,17,18,19,20},
  {21,22,23,24,25,26,27}
  
 
 
};

struct rotariesdef {
  byte pin1;
  byte pin2;
  int ccwchar;
  int cwchar;
  volatile unsigned char state;
};

//ROTARY ENCODERS
//each line controls a different rotary encoder
//the first two numbers refer to the pins the encoder is connected to 
//the second two are the buttons each click of the encoder wil press 
//do NOT exceed 31 for the final button number
rotariesdef rotaries[NUMROTARIES] {
  {0,1,22,23,0}, //rotary 1
  {2,3,24,25,0}, //rotary 2
  {4,5,26,27,0} //rotary 3



};

#define DIR_CCW 0x10
#define DIR_CW 0x20
#define R_START 0x0

#ifdef HALF_STEP
#define R_CCW_BEGIN 0x1
#define R_CW_BEGIN 0x2
#define R_START_M 0x3
#define R_CW_BEGIN_M 0x4
#define R_CCW_BEGIN_M 0x5
const unsigned char ttable[6][4] = {
  // R_START (00)
  {R_START_M,            R_CW_BEGIN,     R_CCW_BEGIN,  R_START},
  // R_CCW_BEGIN
  {R_START_M | DIR_CCW, R_START,        R_CCW_BEGIN,  R_START},
  // R_CW_BEGIN
  {R_START_M | DIR_CW,  R_CW_BEGIN,     R_START,      R_START},
  // R_START_M (11)
  {R_START_M,            R_CCW_BEGIN_M,  R_CW_BEGIN_M, R_START},
  // R_CW_BEGIN_M
  {R_START_M,            R_START_M,      R_CW_BEGIN_M, R_START | DIR_CW},
  // R_CCW_BEGIN_M
  {R_START_M,            R_CCW_BEGIN_M,  R_START_M,    R_START | DIR_CCW},
};
#else
#define R_CW_FINAL 0x1
#define R_CW_BEGIN 0x2
#define R_CW_NEXT 0x3
#define R_CCW_BEGIN 0x4
#define R_CCW_FINAL 0x5
#define R_CCW_NEXT 0x6

const unsigned char ttable[7][4] = {
  // R_START
  {R_START,    R_CW_BEGIN,  R_CCW_BEGIN, R_START},
  // R_CW_FINAL
  {R_CW_NEXT,  R_START,     R_CW_FINAL,  R_START | DIR_CW},
  // R_CW_BEGIN
  {R_CW_NEXT,  R_CW_BEGIN,  R_START,     R_START},
  // R_CW_NEXT
  {R_CW_NEXT,  R_CW_BEGIN,  R_CW_FINAL,  R_START},
  // R_CCW_BEGIN
  {R_CCW_NEXT, R_START,     R_CCW_BEGIN, R_START},
  // R_CCW_FINAL
  {R_CCW_NEXT, R_CCW_FINAL, R_START,     R_START | DIR_CCW},
  // R_CCW_NEXT
  {R_CCW_NEXT, R_CCW_FINAL, R_CCW_BEGIN, R_START},
};
#endif

//BUTTON MATRIX PART 2
byte rowPins[NUMROWS] = {A3,A2,A1,15}; //change "?" to the pins the rows of your button matrix are connected to
byte colPins[NUMCOLS] = {A0,14,16,10,9,8,7}; //change "?" to the pins the rows of your button matrix are connected to

Keypad buttbx = Keypad( makeKeymap(buttons), rowPins, colPins, NUMROWS, NUMCOLS);

//JOYSTICK SETTINGS
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_JOYSTICK,
  32, //number of buttons
  0, //number of hat switches
  //Set as many axis to "true" as you have potentiometers for
  false, // y axis
  false, // x axis
  false, // z axis
  false, // rx axis
  false, // ry axis
  false, // rz axis
  false, // rudder
  false, // throttle
  false, // accelerator
  false, // brake
  false); // steering wheel

const int numReadings = 20;
 
int readings[numReadings];      // the readings from the analog input
int index = 0;              // the index of the current reading
int total = 0;                  // the running total
int currentOutputLevel = 0;

//POTENTIOMETERS PART 1
//add all the axis' which are enabled above
int zAxis_ = 0;
int RxAxis_ = 0;   

               



void setup() {
  
 

void loop() {

  CheckAllEncoders();
  CheckAllButtons();
  CheckAllPotentiometers();
 
}



}

int getAverageOutput(int pinToRead){
  index = 0;
  total = 0; 
 
  while (index < numReadings){
    readings[index] = analogRead(pinToRead);
    total = total + readings[index];
    index = index + 1;
    //delay (1);
  }
  return total / numReadings;
}


void CheckAllButtons(void) {
      if (buttbx.getKeys())
    {
       for (int i=0; i<LIST_MAX; i++)   
        {
           if ( buttbx.key[i].stateChanged )   
            {
            switch (buttbx.key[i].kstate) { 
                    case PRESSED:
                    case HOLD:
                              Joystick.setButton(buttbx.key[i].kchar, 1);
                              break;
                    case RELEASED:
                    case IDLE:
                              Joystick.setButton(buttbx.key[i].kchar, 0);
                              break;
            }
           }   
         }
     }
}


void rotary_init() {
  for (int i=0;i<NUMROTARIES;i++) {
    pinMode(rotaries[i].pin1, INPUT);
    pinMode(rotaries[i].pin2, INPUT);
    #ifdef ENABLE_PULLUPS
      digitalWrite(rotaries[i].pin1, HIGH);
      digitalWrite(rotaries[i].pin2, HIGH);
    #endif
  }
}


unsigned char rotary_process(int _i) {
  //Serial.print("Processing rotary: ");
  //Serial.println(_i);
  unsigned char pinstate = (digitalRead(rotaries[_i].pin2) << 1) | digitalRead(rotaries[_i].pin1);
  rotaries[_i].state = ttable[rotaries[_i].state & 0xf][pinstate];
  return (rotaries[_i].state & 0x30);
}

void CheckAllEncoders(void) {
  Serial.println("Checking rotaries");
  for (int i=0;i<NUMROTARIES;i++) {
    unsigned char result = rotary_process(i);
    if (result == DIR_CCW) {
      Serial.print("Rotary ");
      Serial.print(i);
      Serial.println(" <<< Going CCW");
      Joystick.setButton(rotaries[i].ccwchar, 1); delay(50); Joystick.setButton(rotaries[i].ccwchar, 0);
    };
    if (result == DIR_CW) {
      Serial.print("Rotary ");
      Serial.print(i);
      Serial.println(" >>> Going CW");
      Joystick.setButton(rotaries[i].cwchar, 1); delay(50); Joystick.setButton(rotaries[i].cwchar, 0);
    };
  }
  Serial.println("Done checking");

Please edit your message and insert code in code tag

It looks like you incorrect copied some sketches in one:

Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

have fix the post. sorry

your loop() is inside of setup()

The C language does not allow the nested functions

sorry I'm very new to this. how do i fix it?

move one right curly bracket, now situated after loop() code - in line after setup()

void setup() {
                   // line 2
void loop() {

  CheckAllEncoders();
  CheckAllButtons();
  CheckAllPotentiometers();
 
}

}              // <== move this bracket above to the line marked 2

The Arduino Pro Micro has a different microcontroller ATMega32u4 which has native USB-support inside the microcontroller itself

The Arduino Pro Mini is based on the ATMega328P-microcontroller an additional chip for the USB-connection.

change

to this

void setup() {
  // first line inside the function setup()
  // ..
  // ..
  // last line inside the function setup()
} // <== closing curly brace of function setup()

void loop() { // <== opening curly brace of function loop()
  // first line inside the function loop()

  CheckAllEncoders();
  CheckAllButtons();
  CheckAllPotentiometers();
 
  // last line inside the function loop()
} // <== closing curly brace of function loop

You seem to be a real beginner.
You should either learn a good amount of basics how to use arduinos / arduino-IDE
or
just use projects with a step by step manual where each and every tiny single step is shown by screenshots.

manuals like

"upload this code to the arduino"

are born to fail with knowing nothing about how to use the arduino-ide

best regards Stefan

So i gave up on this code and edited some code from a YouTube tutorial on building a button box. its working great now. sorry for wasting your time, must be very frustrating to explain to people that have no idea. I will have to learn the basics before starting a new project.

Thank you for the help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.