Skip to content

The SparkFun Qwiic Joystick combines the convenience of the Qwiic connection system and an analog joystick that feels reminiscent of the thumbstick from a PlayStation 2 controller.

License

Notifications You must be signed in to change notification settings

sparkfun/Qwiic_Joystick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SparkFun Qwiic Joystick

SparkFun Qwiic Joystick

SparkFun Qwiic Joystick (COM-15168)

Now, you can easily add an HID/controller to your project! The SparkFun Qwiic Joystick combines the convenience of the Qwiic connection system and an analog joystick that feels reminiscent of the thumbstick from a PlayStation 2 controller.

Thanks to an ATtiny85 on the Qwiic Joystick, all the necessary bits are taken care of and your microcontroller only needs to look for your inputs in the registers of the I2C device.

Factory Default I2C Slave Address: 0x20

I2C Registers


Address Contents
0x00 Default I2C Address
0x01-0x02 Firmware Version
0x03-0x04 Horizontal Position (MSB First)
0x05-0x06 Vertical Position (MSB First)
0x07 Button Position; clears after read.
0x08 Button Status: Indicates if button was pressed since last read of button state (i.e. last time reg 0x07 was read).
0x09 Lock Register for I2C Address Change
0x0A Current I2C Slave Address. Can only be changed once Lock Register is set to 0x13, then it clears the Lock Register.

In the registers for the joystick position, the MSB contains the first 8 bits of the 10-bit ADC value and the LSB contains the last two bits. As an example, this is how the library converts the two registers back to a 10-bit value.

uint_16t full10bitvalue = (MSB | LSB)>>6;

You could potentially only look at the MSB and get an 8-bit (256 position) reading. The firmware was intentionally written this way in the hopes that it would be useful for customers who don't need the full resolution of the joystick position.

Repository Contents

  • /Firmware - Firmware for ATtiny85 and Python Example Code
  • /Hardware - Eagle design files (.brd, .sch)

Documentation

  • Library - Arduino library for the Qwiic Joystick.
  • Hookup Guide - Basic hookup guide for the Qwiic Joystick.

Product Versions

  • COM-15168- Retail packaging of standard description here

Version History

License Information

This product is open source!

Please review the LICENSE.md file for license information.

If you have any questions or concerns on licensing, please visit the SparkFun Forum and post a topic. For more general questions related to our qwiic system, please visit this section of the forum: SparkFun Forums: QWIIC SYSTEMS

Distributed as-is; no warranty is given.

  • Your friends at SparkFun.

About

The SparkFun Qwiic Joystick combines the convenience of the Qwiic connection system and an analog joystick that feels reminiscent of the thumbstick from a PlayStation 2 controller.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •