API Reference¶
qwiic_keypad¶
Python module for the[SparkFun Qwiic Keypad - 12 Button Breakout](https://www.sparkfun.com/products/15290)
This python package is a port of the existing [SparkFun Qwiic Keypad Arduino Library](https://github.com/sparkfun/SparkFun_Qwiic_Keypad_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_keypad.
QwiicKeypad
(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 QwiicKeypad device object.
Return type: Object
-
begin
()[source]¶ Initialize the operation of the Keypad module
Returns: Returns true of the initializtion was successful, otherwise False. Return type: bool
-
connected
¶ Determine if a Keypad device is conntected to the system..
Returns: True if the device is connected, otherwise False. Return type: bool
Returns the button at the top of the stack (aka the oldest button).
The return value is the ‘ascii’ value of th key pressed. To convert to a character, use the python char() function.
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
-
is_connected
()[source]¶ Determine if a Keypad device is conntected to the system..
Returns: True if the device is connected, otherwise False. Return type: bool
-
time_since_pressed
()[source]¶ Returns the number of milliseconds since the current button in FIFO was pressed.
Returns: The elapsed time since button was pressed Return type: integer
-
update_fifo
()[source]¶ “commands” keypad to plug in the next button into the registerMap note, this actually sets the bit0 on the updateFIFO register
Returns: No return value
-
version
¶ Returns a string of the firmware version number
Returns: The firmware version Return type: string