Qwiic Joystick Hookup Guide
Python Examples
For installation instructions, please refer to the repository's README file.
Please use the following links and the internet for a better understanding of I2C and how it works in the Arduino IDE:
- For a tutorial on using I2C devices with a Raspberry Pi, please see our Raspberry Pi SPI and I2C Tutorial.
- For a tutorial on Python, please see our Python Programming Tutorial: Getting Started with the Raspberry Pi.
Enable I2C Interface
If it isn't already enabled, enable I2C interface in Preferences > Raspberry Pi Configuration panel.
Check for Device Using Command Line
On the (full) Raspbian OS, i2ctools
should be pre-installed (if it is not, follow the instructions here). With the Qwiic Joystick and Qwiick Hat attached to the Raspberry Pi, run the following command in the terminal/commandline.
i2cdetect -y 1
Download and Run Python Examples
Download the Python Examples from the GitHub repository. All you need to do is open an example python file and execute the module. You can do this in Python 3 or another compatible, programming text editor like Geany.
Basic Readings
Below is a screenshot of the python shell from the Basic Readings example file.
Snake Game
When you run the Snake Game example code, you only need to click the button to start the game. (*Shout out to Al Sweigart for his Wormy example, which was adapted to work with the Qwiic Joystick.)
[Errno 121] Remote I/O error
is an issue with the I2C bus and how SMBUS interacts with the slave device.You will also get an
[Errno 121] Remote I/O error
if your I2C address is defined wrong.