sparkfun_qwiictwist

CircuitPython library for the Sparkfun Qwiic Twist Rotary Encoder

  • Author(s): Gaston Williams

Implementation Notes

Hardware:

  • This is library is for the SparkFun Qwiic Joystick.
  • SparkFun sells these at its website: www.sparkfun.com
  • Do you like this library? Help support SparkFun. Buy a board! https://www.sparkfun.com/products/15083

Software and Dependencies:

class sparkfun_qwiictwist.Sparkfun_QwiicTwist(i2c, address=63, debug=False)

CircuitPython class for the Sparkfun QwiicTwist RGB Rotary Encoder

blue

Get the value of the blue LED

blue_connection

Get the value of the blue LED connection.

change_address(new_address)

Change the i2c address of Twist Rotary Encoder snd return True if successful.

clear_interrupts()

Clears the moved, clicked, and pressed bits

clicked

Return true if a click event has occurred. Event flag is then reset.

connect_color(red_value, green_value, blue_value)

Connect all the rgb color for the encoder LEDs

connected

Check the id of Rotary Encoder. Returns True if successful.

count

Returns the number of indents since the user turned the knob.

difference

Return the difference in number of clicks since previous check. The value is cleared after it is read.

green

Get the value of the green LED.

green_connection

Get the value of the green LED connection.

int_timeout

Get number of milliseconds that elapse between the end of the knob turning and interrupt firing.

moved

Return true if the knob has been twisted.

pressed

“Return true if button is currently pressed.

red

Get the value of the red LED.

red_connection

Get the value of the red LED connection

set_color(red_value, green_value, blue_value)

Set the rgb color of the encoder LEDs

time_since_last_movement

Return the number of milliseconds since the last encoder movement

time_since_last_press

Return the number of milliseconds since the last button press and release

version

Return the version string for the Twist firmware.