Package: adafruit-circuitpython-qwiictwist
IntroductionCircuitPython library for Sparkfun Qwiic Twist RGB Rotary Encoder.  This library is ported fromSparkFun Qwiic Twist Arduino LibrarySparkFun Qwiic Twist RGB Rotary Encoder (DEV-15083)DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit Bus DeviceQwiic Twist RGB Rotary Encoder HardwarePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Raspberry Pi SetupAdafruit has an excellent tutorial onInstalling CircuitPython Libraries on Raspberry Pi.Quick Start Summary:Start with the latest version of Raspbian with Wifi configured.Enable SSH, I2C and SPI.sudoraspi-configUpdate your system to the latest version.sudoapt-getupdatesudoapt-getupgradeUpdate the python toolssudopip3install--upgradesetuptools(If pip3 is not installed, install it and rerun the command)sudoapt-getinstallpython3-pipInstall the CircuitPython librariespip3installRPI.GPIOpip3installadafruit-blinkaInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.Installing this library will also install the dependency adafruit-circuitpython-busdevice.Installing from PyPIpip3installsparkfun-circuitpython-qwiictwistTo install system-wide (this may be required in some cases):sudopip3installsparkfun-circuitpython-qwiictwistTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installsparkfun-circuitpython-qwiictwistUsage ExampleQwiic Twist Hookup Guide- The Arduino examples in the Hookup Guide are available for Python with this libraryCircuitPython on a Raspberry Pi- Basic information on how to install CircuitPython on a Raspberry Pi.Code Example:# import the CircuitPython board and busio librariesimportboardimportbusio# Create bus object using the board's I2C porti2c=busio.I2C(board.SCL,board.SDA)twist=QwiicTwist(i2c)# default address is 0x3F# For a different address use QwiicTwist(i2c, address)
# twist = QwiicTwist(i2c, 0x3E)ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyZip release filesTo build this library locally you’ll need to install thecircuitpython-build-toolspackage.python3-mvenv.envsource.env/bin/activatepipinstallcircuitpython-build-toolsOnce installed, make sure you are in the virtual environment:source.env/bin/activateThen run the build:circuitpython-build-bundles--filename_prefixsparkfun-circuitpython-qwiictwist--library_location.Sphinx documentationSphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):python3-mvenv.envsource.env/bin/activatepipinstallSphinxsphinx-rtd-themeNow, once you have the virtual environment activated:cddocssphinx-build-E-W-bhtml._build/htmlThis will output the documentation todocs/_build/html. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.License InformationThis product isopen source!Please review the LICENSE.md file for license information.Please use, reuse, and modify these files as you see fit.Please maintain the attributions to SparkFun Electronics and Adafruit and release any derivative under the same license.Distributed as-is; no warranty is given.