checkButton()
Indicates if the button was pressed between reads of the button state or calls of this function. The register for this
indicator is then cleared.
Output: byte
0 - Button is was NOT pressed.
1 - Button is was pressed.
getVersion()
Returns a string of the firmware version number.
Output: String AAA.BBB
AAA - Firmware Version (Major)
BBB - Firmware Version (Minor)
Examples
There are four examples in the Qwiic Joystick Arduino Library to get you started with using Qwiic Joystick. These
example files are named with self-explanatory titles, but in case you want more information, see the descriptions
below.
Example1_Basic_Readings
This example connects to the Qwiic Joystick using the default I C address saved in the library. The sketch
looks at the registers for the current joystick position and button state. The example then prints out those
values over the Serial Monitor.
Example2_I2C_Address_and_Firmware
This example connects to the Qwiic Joystick using the default I C address set in the sketch and then prints
out the I C address and firmware version over the Serial Monitor. The sketch then, takes an input from the
Serial Monitor to change the I C address using a decimal value (DEC). Once the I C address is changed, it
is stored in the EEPROM of the Qwiic Joystick. After, the sketch connects to the joystick using the new I C
address and reads the registers for the firmware version again. The example then prints out those values
over the Serial Monitor again.
Example3_I2C_Scanner
This example is from the I C scanner example from the Arduino Playground webpage. The sketch scans for
devices on the I C bus and reports them on the Serial Monitor. This is useful for users who have forgotten
the changed I C address of their boards.
Example4_Joystic_Serial_Output
This example shows a basic example of how to begin to use the Qwiic Joystick as an HID. The example
sketch takes values of the joystick and converts it to directional printouts on the Serial Monitor.
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 I C devices with the Arduino IDE.
Please use the following links and the internet for a better understanding of I C and how it works in the
Arduino IDE:
2
2
2
2 2
2
2
2
2
2
2