A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sparkfun/Qwiic_Joystick below:

sparkfun/Qwiic_Joystick: 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.

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
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.

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4