Qwiic_Joystick_Py  2.0.0
Python for SFE Qwiic Joystick
Loading...
Searching...
No Matches
qwiic_joystick.QwiicJoystick Class Reference

QwiicJoystick. More...

Inheritance diagram for qwiic_joystick.QwiicJoystick:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None)
 
def is_connected (self)
 Determine if a Joystick device is conntected to the system. More...
 
def begin (self)
 Initialize the operation of the Joystick module. More...
 
def get_horizontal (self)
 Returns the 10-bit ADC value of the joystick horizontal position. More...
 
def get_vertical (self)
 Returns the 10-bit ADC value of the joystick vertical position. More...
 
def get_button (self)
 Returns 0 button is currently being pressed. More...
 
def check_button (self)
 Returns 1 if button was pressed between reads of .getButton() or .checkButton() the register is then cleared after read. More...
 
def get_version (self)
 Returns a string of the firmware version number. More...
 

Public Attributes

 address
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 

Properties

 connected = property(is_connected)
 
 horizontal = property(get_horizontal)
 
 vertical = property(get_vertical)
 
 button = property(get_button)
 
 version = property(get_version)
 

Detailed Description

QwiicJoystick.

Parameters
addressThe I2C address to use for the device. If not provided, the default address is used.
i2c_driverAn existing i2c driver object. If not provided a driver object is created.
Returns
The

Constructor & Destructor Documentation

◆ __init__()

def qwiic_joystick.QwiicJoystick.__init__ (   self,
  address = None,
  i2c_driver = None 
)

Member Function Documentation

◆ begin()

def qwiic_joystick.QwiicJoystick.begin (   self)

Initialize the operation of the Joystick module.

Returns
bool Returns true of the initializtion was successful, otherwise False.

◆ check_button()

def qwiic_joystick.QwiicJoystick.check_button (   self)

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

Returns
integer button status

◆ get_button()

def qwiic_joystick.QwiicJoystick.get_button (   self)

Returns 0 button is currently being pressed.

Returns
integer button status

◆ get_horizontal()

def qwiic_joystick.QwiicJoystick.get_horizontal (   self)

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

Returns
byte as integer The next button value

◆ get_version()

def qwiic_joystick.QwiicJoystick.get_version (   self)

Returns a string of the firmware version number.

Returns
string The firmware version

◆ get_vertical()

def qwiic_joystick.QwiicJoystick.get_vertical (   self)

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

Returns
byte as integer The next button value

◆ is_connected()

def qwiic_joystick.QwiicJoystick.is_connected (   self)

Determine if a Joystick device is conntected to the system.

Returns
bool True if the device is connected, otherwise False.

Member Data Documentation

◆ address

qwiic_joystick.QwiicJoystick.address

◆ available_addresses

qwiic_joystick.QwiicJoystick.available_addresses = _AVAILABLE_I2C_ADDRESS
static

◆ device_name

qwiic_joystick.QwiicJoystick.device_name = _DEFAULT_NAME
static

Property Documentation

◆ button

qwiic_joystick.QwiicJoystick.button = property(get_button)
static

◆ connected

qwiic_joystick.QwiicJoystick.connected = property(is_connected)
static

◆ horizontal

qwiic_joystick.QwiicJoystick.horizontal = property(get_horizontal)
static

◆ version

qwiic_joystick.QwiicJoystick.version = property(get_version)
static

◆ vertical

qwiic_joystick.QwiicJoystick.vertical = property(get_vertical)
static

The documentation for this class was generated from the following file: