Qwiic Joystick Hookup Guide

Pages
Contributors: santaimpersonator
Favorited Favorite 5

Arduino Examples

Note: This section is an example of using the Qwiic Joystick and the RedBoard Qwiic with the Arduino IDE. It is not intended to be a guide for using I2C devices with the Arduino IDE.

Please use the following links and the internet for a better understanding of I2C and how it works in the Arduino IDE:

Example 1: Basic Readings

This sketch looks at the registers for the current joystick position and button state; the values are sent to the Serial Monitor. Make sure you are using a baudrate of 9600bps.

Serial monitor print out with joystick position and button presses

Example 2: I2C Address Change and Firmware Version Read

This sketch takes an entry from the Serial Monitor, in a decimal value, and changes the I2C address of the device. The firmware version is then read to confirm that the address was changed. Make sure you are using a baudrate of 9600bps.

Serial monitor print out of I<sup>2</sup>C address changes

Example 3: I2C Scanner

This sketch is from the I2C scanner example from the Arduino Playground webpage. The sketch scans for devices on the I2C bus and reports them on the Serial Monitor. Make sure you are using a baudrate of 9600bps.

Example 4: Joystick Serial Output

This sketch takes values of the joystick and converts it to directional printouts on the Serial Monitor. It also reads out if the button was pressed. Make sure you are using a baudrate of 9600bps.

Labeling of Qwiic Joystick for serial monitor print out