![]() |
Qwiic_Twist_Py
Python for SFE Qwiic Twist
|
Public Member Functions | |
def | __init__ (self, address=None, i2c_driver=None) |
def | is_connected (self) |
Determine if a Tesit device is conntected to the system. More... | |
def | begin (self) |
Initialize the operation of the Twist module. More... | |
def | clear_interrupts (self) |
Clears the moved, clicked, and pressed bits. More... | |
def | get_count (self) |
Returns the number of indents the user has twisted the knob. More... | |
def | set_count (self, amount) |
Set the encoder count to a specific amount. More... | |
def | get_limit (self) |
Returns the limit of allowed counts before wrapping. More... | |
def | set_limit (self, amount) |
Set the encoder count limit to a specific amount. More... | |
def | get_diff (self, clear_value=False) |
Returns the number of ticks since last check. More... | |
def | is_pressed (self) |
Returns true if button is currently being pressed. More... | |
def | was_clicked (self) |
Returns true if a click event has occurred. More... | |
def | has_moved (self) |
Returns true if knob has been twisted. More... | |
def | since_last_movement (self, clear_value=True) |
Returns the number of milliseconds since the last encoder movement By default, clear the current value. More... | |
def | since_last_press (self, clear_value=True) |
Returns the number of milliseconds since the last button event (press and release) By default, clear the current value. More... | |
def | set_color (self, red, green, blue) |
Sets the color of the encoder LEDs. More... | |
def | set_red (self, red) |
Sets the red color of the encoder LEDs. More... | |
def | get_red (self) |
Gets the red color of the encoder LEDs. More... | |
def | set_green (self, green) |
Sets the green color of the encoder LEDs. More... | |
def | get_green (self) |
Gets the green color of the encoder LEDs. More... | |
def | set_blue (self, blue) |
Sets the blue color of the encoder LEDs. More... | |
def | get_blue (self) |
Gets the blue color of the encoder LEDs. More... | |
def | get_version (self) |
Returns a integer of the firmware version number. More... | |
def | connect_color (self, red, green, blue) |
Sets the relation between each color and the twisting of the knob Connect the LED so it changes [amount] with each encoder tick Negative numbers are allowed (so LED gets brighter the more you turn the encoder down) More... | |
def | set_connect_red (self, red) |
Sets the connect red color of the encoder LEDs. More... | |
def | get_connect_red (self) |
Gets the connect red color of the encoder LEDs. More... | |
def | set_connect_green (self, green) |
Sets the connect green color of the encoder LEDs. More... | |
def | get_connect_green (self) |
Gets the connect green color of the encoder LEDs. More... | |
def | set_connect_blue (self, blue) |
Sets the connect blue color of the encoder LEDs. More... | |
def | get_connect_blue (self) |
Gets the connect blue color of the encoder LEDs. More... | |
def | set_int_timeout (self, timeout) |
Set number of milliseconds that elapse between end of knob turning and interrupt firing. More... | |
def | get_int_timeout (self) |
Get number of milliseconds that elapse between end of knob turning and interrupt firing. More... | |
Public Attributes | |
address | |
Static Public Attributes | |
device_name = _DEFAULT_NAME | |
available_addresses = _AVAILABLE_I2C_ADDRESS | |
Properties | |
connected = property(is_connected) | |
count = property(get_count, set_count) | |
limit = property(get_limit, set_limit) | |
pressed = property(is_pressed) | |
clicked = property(was_clicked) | |
moved = property(has_moved) | |
red = property(get_red, set_red) | |
green = property(get_green, set_green) | |
blue = property(get_blue, set_blue) | |
version = property(get_version) | |
connect_red = property(get_connect_red, set_connect_red) | |
connect_green = property(get_connect_green, set_connect_green) | |
connect_blue = property(get_connect_blue, set_connect_blue) | |
int_timeout = property(get_int_timeout, set_int_timeout) | |
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. |
def qwiic_twist.QwiicTwist.__init__ | ( | self, | |
address = None , |
|||
i2c_driver = None |
|||
) |
def qwiic_twist.QwiicTwist.begin | ( | self | ) |
Initialize the operation of the Twist module.
def qwiic_twist.QwiicTwist.clear_interrupts | ( | self | ) |
Clears the moved, clicked, and pressed bits.
def qwiic_twist.QwiicTwist.connect_color | ( | self, | |
red, | |||
green, | |||
blue | |||
) |
Sets the relation between each color and the twisting of the knob Connect the LED so it changes [amount] with each encoder tick Negative numbers are allowed (so LED gets brighter the more you turn the encoder down)
red | Red component |
green | Green component |
blue | Blue component |
def qwiic_twist.QwiicTwist.get_blue | ( | self | ) |
Gets the blue color of the encoder LEDs.
def qwiic_twist.QwiicTwist.get_connect_blue | ( | self | ) |
Gets the connect blue color of the encoder LEDs.
def qwiic_twist.QwiicTwist.get_connect_green | ( | self | ) |
Gets the connect green color of the encoder LEDs.
def qwiic_twist.QwiicTwist.get_connect_red | ( | self | ) |
Gets the connect red color of the encoder LEDs.
def qwiic_twist.QwiicTwist.get_count | ( | self | ) |
Returns the number of indents the user has twisted the knob.
def qwiic_twist.QwiicTwist.get_diff | ( | self, | |
clear_value = False |
|||
) |
Returns the number of ticks since last check.
clearValue | Set to True to clear the current value. Default is False |
def qwiic_twist.QwiicTwist.get_green | ( | self | ) |
Gets the green color of the encoder LEDs.
def qwiic_twist.QwiicTwist.get_int_timeout | ( | self | ) |
Get number of milliseconds that elapse between end of knob turning and interrupt firing.
def qwiic_twist.QwiicTwist.get_limit | ( | self | ) |
Returns the limit of allowed counts before wrapping.
0 is disabled
def qwiic_twist.QwiicTwist.get_red | ( | self | ) |
Gets the red color of the encoder LEDs.
def qwiic_twist.QwiicTwist.get_version | ( | self | ) |
Returns a integer of the firmware version number.
def qwiic_twist.QwiicTwist.has_moved | ( | self | ) |
Returns true if knob has been twisted.
def qwiic_twist.QwiicTwist.is_connected | ( | self | ) |
Determine if a Tesit device is conntected to the system.
def qwiic_twist.QwiicTwist.is_pressed | ( | self | ) |
Returns true if button is currently being pressed.
def qwiic_twist.QwiicTwist.set_blue | ( | self, | |
blue | |||
) |
Sets the blue color of the encoder LEDs.
blue | blue component |
def qwiic_twist.QwiicTwist.set_color | ( | self, | |
red, | |||
green, | |||
blue | |||
) |
Sets the color of the encoder LEDs.
red | Red component |
green | Green component |
blue | Blue component |
def qwiic_twist.QwiicTwist.set_connect_blue | ( | self, | |
blue | |||
) |
Sets the connect blue color of the encoder LEDs.
blue | blue component |
def qwiic_twist.QwiicTwist.set_connect_green | ( | self, | |
green | |||
) |
Sets the connect green color of the encoder LEDs.
green | Green component |
def qwiic_twist.QwiicTwist.set_connect_red | ( | self, | |
red | |||
) |
Sets the connect red color of the encoder LEDs.
red | Red component |
def qwiic_twist.QwiicTwist.set_count | ( | self, | |
amount | |||
) |
Set the encoder count to a specific amount.
amount | the value to set the counter to |
def qwiic_twist.QwiicTwist.set_green | ( | self, | |
green | |||
) |
Sets the green color of the encoder LEDs.
green | Green component |
def qwiic_twist.QwiicTwist.set_int_timeout | ( | self, | |
timeout | |||
) |
Set number of milliseconds that elapse between end of knob turning and interrupt firing.
timeout | the timeout value in milliseconds |
def qwiic_twist.QwiicTwist.set_limit | ( | self, | |
amount | |||
) |
Set the encoder count limit to a specific amount.
amount | the value to set the limit to |
def qwiic_twist.QwiicTwist.set_red | ( | self, | |
red | |||
) |
Sets the red color of the encoder LEDs.
red | Red component |
def qwiic_twist.QwiicTwist.since_last_movement | ( | self, | |
clear_value = True |
|||
) |
Returns the number of milliseconds since the last encoder movement By default, clear the current value.
clearValue | Clear out the value? True by default |
def qwiic_twist.QwiicTwist.since_last_press | ( | self, | |
clear_value = True |
|||
) |
Returns the number of milliseconds since the last button event (press and release) By default, clear the current value.
clearValue | Clear out the value? False by default |
def qwiic_twist.QwiicTwist.was_clicked | ( | self | ) |
Returns true if a click event has occurred.
qwiic_twist.QwiicTwist.address |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |