Package: ht16k33-python
HT16K33 Drivers 3.5.3This repo provides Python drivers for the Holtek HT16K33 controller chip and various display devices based upon it, such as theAdafruit 0.8-inch 8x16 LED Matrix FeatherWingand theRaspberry Pi Pico.The library also supports generic seven-segment displays wired up to an HT16K33, which can drive up to eight these LEDs. The HT16K33 may be on a board of your own design, or on a third-part one, such as theAdafruit 16x8 LED Matrix Driver Backpack. LED units you can connect range fromsingle digitsup to combinations ofmulti-digit units.Connect your HT16K33 column pins to each LED's digit selection pin, and its row pins to the LED's segment selection pins.The drivers support bothCircuitPythonandMicroPythonapplications. They communicate using I²C.Display DriversDriver(Click for docs)Example ProductSmall 4-digit, 7-segment LEDAdafruit 0.56-inch 4-digit, 7-segment LED displayLarge 4-digit, 7-segment LEDAdafruit 1.2-inch 4-digit, 7-segment LED displaySmall 4-digit, 14-segment LEDSparkFun Qwiic Alphanumeric Display,Adafruit 0.54in Alphanumeric Display8x8 monochrome matrix LEDAdafruit Mini 0.8-inch 8x8 LED Matrix8x8 bi-colour matrix LEDAdafruit 1.2-inch 8x8 bi-color LED matrix backpack16x8 FeatherWing matrix LEDAdafruit 0.8-inch 8x16 LED Matrix FeatherWingStandalone HT16K33Adafruit 16x8 LED Matrix Driver BackpackFurther drivers may be added in due course.Import the DriversThe driver package comprises a parent generic HT16K33 class and child classes for various displays themselves. All your code needs to do isimportthe latter. For example:fromht16k33segmentimportHT16K33SegmentYou can then instantiate the driver object. This requires aconfiguredI2C bus object.You will need both the display driver file andht16k33.pyin your project folder.Install the DriversMicroPython ManualUse thepyboardormpremotecommand line tools to copy theht16k33.pyand your required device-specific driver to your board.MicroPython MIP InstallFrom version 3.5.2, you can install the drivers usingMicroPython's MIP module. This requires a board running MicroPython 1.20 or above and connected to the Internet. Add the following to your code:importmipmip.install('github:smittytone/HT16K33-Python')If your board is not Internet-capable, you can install locally usingthempremotetool:mpremotemipinstallgithub:smittytone/HT16K33-PythonCircuitPython InstallCopyht16k33.pyand your required driver.pyfile(s) to the mounted board'slibfolder.Reducing Memory UsageAdding the driver code may prove too much for certain CircuitPython devices which have limited amounts of memory. To overcome this,use MicroPython’smpy-crosscompiler. This will compile the raw Python into a highly compact form as a.mpyfile. Copyht16k33.mpyand the device-specific.mpyfile to your device in place of the.pyversions.Example./mpy-crossht16k33.pyht16k33matrixcolour.pyDocumentationYou can find documentation for all of the driversat smittytone.net.Python Package IndexThis code is now availablevia the Python Package Indexfor folks using Thonny and other code-pulling IDEs.Release Notes3.5.315 January 2024Remove the.mpyversions and provide instructions instead.Fix incorrect selection of blink rate 0.5Hz — thanks,@Karrp.3.5.211 December 2023Addmipsupport — thanks,@ubidefeo(no code changes).3.5.130 October 2023Add provisionalPyPIsupport (no code changes).3.5.02 September 2023AddHT16K33SegmentGena generic, 1-8 digit 7-segment driver — thanks,@vader7071.3.4.214 February 2023Fix an error when a space is shown as a zero — thanks,@asasine.3.4.114 November 2022Correct VK16K33 naming.Fix VK16K33 colon setting and unsetting — thanks, Dietmar Schüller.3.4.06 October 2022Allow the colon and decimal point onSparkFun Qwiic Alphanumeric Display).3.3.113 September 202214-segment character-set numerals now match 7-segment equivalents.Assorted code tweaks.Wrangle and extend examples.Remove old docs.Big thanks to@akbioccafor assistance with this release.3.3.05 August 2022Addrotate()method to HT16K33Segment.3.2.026 July 2022Support theAdafruit 0.54in Alphanumeric Displayviaht16k33segment14.py.Bug fixes.3.1.016 February 2022Addht16k33segment14.pyto support theSparkFun Qwiic Alphanumeric Display.3.0.223 November 2020Refactor out someht16k33matrix.pycode.3.0.17 November 2020Correct variable name inht16k33matrix.py.3.0.06 November 2020Initial public release.Licence and CopyrightThis repository’s source code and documentation is copyright © 2024, Tony Smith (@smittytone).The HTK16K33 driver and subsidiary display drivers are licensed under theMIT License.