ARDUINO LIBRARIES


Here is a collection of Arduino libraries that I have found useful when creating game controllers. Libraries are files that can be added to the Arduino IDE to provide additional functionality. For libraries that are not built into the IDE, the links below will take you to the project’s GitHub page for download. If you are unsure of how to install these libraries, here is a link to the official Arduino guide.

 

Default Libraries

These libraries are built into the IDE and do not require installation.


KEYBOARD

This library enables you to send keystrokes to a connected computer. The library is essential to making controllers and is used in every program I make. This includes the Keyboard.press() and Keyboard.release() functions. Keyboard.h is included with IDE, but requires an ATmega32u4 based microcontroller such as the Arduino Leonardo, Arduino Micro, or Teensy.

 

MOUSE

This library enables you to send mouse commands to a connected computer. This includes the Mouse.move(), Mouse.press(), and Mouse.release() functions. Mouse.h is included with IDE, but requires an ATmega32u4 based microcontroller such as the Arduino Leonardo, Arduino Micro, or Teensy.

 

WIRE

This library enables you to communicate with I2C devices over the SDA (data) and SCL (clock) pins. Wire.h is included with IDEA and does not require installation. I2C devices that I commonly use for game controllers include the MPU-6050 and the Wii Nunchuk.

 

Additional Libraries

These libraries must be downloaded and installed.


MPU-6050

Author: Jeff Rowburg - GitHub Link

This library is essential for using the MPU-6050 sensor. The library enables easy readings for the MEMS accelerometer and MEMS gyroscope to find the position and acceleration along the XYZ axes. Communication uses the I2C bus through the SCL and SDA pins.

 

NINTENDO EXTENSION CTRL

Author: David Madison - GitHub Link

This library enables simplified input readings from a wide selection of Nintendo extension controllers; The most important of which is the Wii Nunchuk. The library provides data for the joystick, C and Z buttons, and the built in accelerometer. Communication uses the I2C bus through the SCL and SDA pins.

 

HID BUTTONS

Author: David Madison - GitHub Link

This library greatly simplifies the code required to track the use of buttons and joysticks on your controller. This removes the need to have statues variables and if statements to avoid button spamming for every loop of the program cycle.