API Reference

qwiic_joystick

Python module for the[SparkFun Qwiic Joystick](https://www.sparkfun.com/products/15168)

This python package is a port of the existing [SparkFun Qwiic Joystick Arduino Library](https://github.com/sparkfun/SparkFun_Qwiic_Joystick_Arduino_Library)

This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)

New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).

class qwiic_joystick.QwiicJoystick(address=None, i2c_driver=None)[source]
Parameters:
  • address – The I2C address to use for the device. If not provided, the default address is used.
  • i2c_driver – An existing i2c driver object. If not provided a driver object is created.
Returns:

The QwiicJoystick device object.

Return type:

Object

begin()[source]

Initialize the operation of the Joystick module

Returns:Returns true of the initializtion was successful, otherwise False.
Return type:bool
button

Returns 0 button is currently being pressed.

Returns:button status
Return type:integer
check_button()[source]

Returns 1 if button was pressed between reads of .getButton() or .checkButton() the register is then cleared after read.

Returns:button status
Return type:integer
connected

Determine if a Joystick device is conntected to the system..

Returns:True if the device is connected, otherwise False.
Return type:bool
get_button()[source]

Returns 0 button is currently being pressed.

Returns:button status
Return type:integer
get_horizontal()[source]

Returns the 10-bit ADC value of the joystick horizontal position

Returns:The next button value
Return type:byte as integer
get_version()[source]

Returns a string of the firmware version number

Returns:The firmware version
Return type:string
get_vertical()[source]

Returns the 10-bit ADC value of the joystick vertical position

Returns:The next button value
Return type:byte as integer
horizontal

Returns the 10-bit ADC value of the joystick horizontal position

Returns:The next button value
Return type:byte as integer
is_connected()[source]

Determine if a Joystick device is conntected to the system..

Returns:True if the device is connected, otherwise False.
Return type:bool
version

Returns a string of the firmware version number

Returns:The firmware version
Return type:string
vertical

Returns the 10-bit ADC value of the joystick vertical position

Returns:The next button value
Return type:byte as integer