Sparkfun

Joystick Breakout Board with Qwiic (COM-15168)

(No reviews yet) Write a Review
SKU:
PPCOM-15168
  • Joystick Breakout Board with Qwiic - SparkFun COM-15168 main
  • Joystick Breakout Board with Qwiic - SparkFun COM-15168 dimensions
  • Joystick Breakout Board with Qwiic - SparkFun COM-15168 top view
  • Joystick Breakout Board with Qwiic - SparkFun COM-15168 rear
£10.50

Description

Joystick Breakout Board with Qwiic - SparkFun 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 and for that reason it's become a favorite of ours. The only thing that could make it better is a "smart" version, so we made one! With the pre-installed firmware, the ATtiny85 is acting as an intermediary (microcontroller) for the analog and digital inputs from the joystick. This allows the Qwiic Joystick to report its position over I2C.

Utilizing the Sparkfun Qwiic system means that no soldering is required to connect it to the rest of your system. However, just in case there are 0.1"-spaced pins broken out in case you prefer to use a breadboard.

The joystick is similar to the analog joysticks on PS2 (PlayStation 2) controllers. Directional movements are simply measured with two 10 kΩ potentiometers, connected with a gimbal mechanism that separates the horizontal and vertical movements. This joystick also has a select button that is actuated when the joystick is pressed down.

The SparkFun Qwiic Joystick's I2C address is also software selectable so you can plenty of them to the same bus without any risk of collision!

Getting Started with the QWIIC Joystick:

There is a power status LED to help make sure that your Qwiic Joystick is getting power. You can power the board either through the polarized Qwiic connector system or the breakout pins (PWR and GND) provided. The Qwiic system is meant to run on 3.3V, be sure that you are NOT using another voltage when using the Qwiic system.
The two potentiometers are connected to the analog to digital converter (ADC) of the ATtiny85. The select button operates as a digital input on the ATtiny85. This allows the firmware to read the knob position and any button presses.
QWIIC Joystick orientation
The potentiometers are the two blue or black boxes on the sides of the joystick. If you move the joystick while watching the center shaft of each potentiometer, you'll see that each of the potentiometers will pick up movement on only one axis.
QWIIC Joystick POT Adjustment
The joystick also contains a momentary button that activates when you push down on the cap. The button is the small black box on the side of the joystick. If you push down on the cap, you can see a lever pushing down on the head of the button. The lever works no matter what position the joystick is in.

QWIIC Joystick Select Button

Example Arduino Code - QWIIC Joystick:


You'll need to download and install the Sparkfun QWIIC Joystick Arduino Library from the documents section below.
[code language="arduino"]
#include
#include "SparkFun_Qwiic_Joystick_Arduino_Library.h"
uint8_t Address = 0x20; //Start address (Default 0x20)
JOYSTICK joystick; //Create instance of this object
void setup() {
Serial.begin(9600);
Serial.println("Qwiic Joystick Example");
if(joystick.begin(Wire, Address) == false)
{
Serial.println("Joystick does not appear to be connected. Please check wiring. Freezing...");
while(1);
}
}
void loop() {
int X = joystick.getHorizontal();
int Y = joystick.getVertical();
int B = joystick.getButton();
if (X > 575)
{
Serial.println("L");
}
else if (X < 450)
{
Serial.println("R");
}
if (Y > 575)
{
Serial.println("U");
}
else if (Y < 450)
{
Serial.println("D");
}
if (B == 0)
{
Serial.println("Button");
}
delay(200);
}
[/code]

Documents:

Notes:

  • The I2C address of the Qwiic Joystick is 0x20 and is software configurable. A multiplexer/Mux is required to communicate to multiple Qwiic Joystick sensors on a single bus
View AllClose

Additional Information

Brand:
SparkFun
Part Number:
COM-15168
Barcode:
845156009558
View AllClose