HT16K33-Python
HT16K33-Python copied to clipboard
OSError: [Errno 5] EIO OR TypeError: function takes 3 positional arguments but 2 were given
MPY: soft reboot Traceback (most recent call last): File "<stdin>", line 12, in <module> File "/lib/ht16k33/ht16k33matrixmulti.py", line 24, in __init__ File "/lib/ht16k33/ht16k33matrix.py", line 131, in __init__ File "/lib/ht16k33/ht16k33.py", line 35, in __init__ File "/lib/ht16k33/ht16k33.py", line 95, in power_on File "/lib/ht16k33/ht16k33.py", line 120, in _write_cmd OSError: [Errno 5] EIO
`''' Adapted from: (Original source) https://github.com/smittytone/HT16K33-Python
''' from machine import I2C, Pin, RTC from ht16k33 import HT16K33MatrixMulti
i2c = I2C(0, scl=Pin(9), sda=Pin(8)) display = HT16K33MatrixMulti(i2c, 2) display.set_brightness(2).clear()
image = [0x01,0x03,0x07,0x0F,0x1D,0x3F,0x7F,0xEB,0xFF,0x77,0x3E,0x1F,0x0D,0x07,0x03,0x01,0x01,0x03,0x07,0x0D,0x0F,0x07,0x03,0x01,0x01,0x03,0x07,0x0F,0x1D,0x3F,0x7F,0xEB,0xFF,0x77,0x3E,0x1F,0x0D,0x07,0x03,0x01,0x01,0x03,0x07,0x0D,0x0F,0x07,0x03,0x01,0xC1,0xC3,0x07,0x0F,0x0F,0x07,0x03,0x01] image_bytes = bytes(image) display.scroll_image(image_bytes) display.scroll_text("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") `
The /lib/ht16k33 folder contains all the library modules incl init.py
If I exclude the ",2" in the display object I get the following error:
`MPY: soft reboot
Traceback (most recent call last):
File "
`
I fail to determine the cause. Any suggestions what I could be missing?
I do have one module containing 2 8x8 matrix displays.
You say one module, two LEDs. Which product are you using?
The current version of the library was written for two LEDs each with its own controller, so I think what you're seeing is the result of the code trying to talk to what it thinks are two controllers both with the same I2C address.
Support for your kind of setup (if I've understood you correctly) is coming in a future release.
I am trying to find the test/demo code that did work - albeit it displayed only on one of the LED's - which is what the demo claimed to do. I am using Pico-WH with Thonny and: MPY: soft reboot MicroPython v1.24.1 on 2024-11-29; Raspberry Pi Pico W with RP2040
Thanks for the pic. I think that confirms it. The HT16K33 can support two displays, but most boards only include one display. As I say, I'll look at adding support for setups like yours in a future update.
Thanks Tony...Will look forward to that release.
In the mean time, I have managed to completely loose what I had working. At some point in Thonny I had executed one of your "test"/"demo" codes for this LED matrix and it worked - i.e. the results showed up on one of the LED displays. Now for the past 2 days I can't seem to recreate that setup in Thonny. I realize this does not help... but in short, what do I need to get the necessary modules and the demo code that would work (in one LED) for my hardware setup? I am pretty sure, the modules I had were from the previous release of your library (before the multi support was added). I think I overwrote those modules. how to I get that release of the modules?
Alternatively, can you please provide me with the modules and the test code that will work on one display? Thanks a lot.
Just use the latest version (4.2.0) and use ht16k33matrix in place of ht16k33matrixmulti. The addition of the latter was the only change.