-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ht1621 demo error #72
Comments
Just refreshing myself with that driver code and noticed your comment - rm-hull/luma.lcd#45 (comment) Presume you're on python3? |
Yep. |
So it looks like the ht1621 doesn't quite conform to the same interface as the other drivers, and because Presumably if you write a simple test program as described in https://luma-lcd.readthedocs.io/en/latest/python-usage.html#seven-segment-drivers, the driver works? I think one possible 'fix' for this would be to change the constructor to be: def __init__(self, serial_interface=None, width=6, rotate=0, WR=11, DAT=10, CS=8, **kwargs):
super(ht1621, self).__init__(luma.lcd.const.ht1621, noop())
self.capabilities(width, 8, rotate)
self.segment_mapper = dot_muncher
self._gpio = kwargs.get('gpio') or self.__rpi_gpio__() This should be compatible with the cmdline/demo-opts and continue to work for direct invocation, but I'm not in a position to test this at the moment, could you try it? |
As to your other comment, in the headline about a missing config: as everything is defaulted in the constructor, the only thing a config file would contain is:
We can add it if you like? |
Yep!
Same here, but will do.
Sound good (for newbies). |
Created #75 for the config file, still need to test the suggested fix for that error. |
Closed too soon, that PR shouldn't have closed this. |
@rm-hull tried your fix and getting the same error:
the traceback also doesn't refer to luma.lcd specifically, hence the fix doesn't work? patch I used: diff --git a/luma/lcd/device.py b/luma/lcd/device.py
index a9f518a..b80df97 100644
--- a/luma/lcd/device.py
+++ b/luma/lcd/device.py
@@ -270,7 +270,7 @@ class ht1621(device):
super(ht1621, self).__init__(luma.lcd.const.ht1621, noop())
self.capabilities(width, 8, rotate)
self.segment_mapper = dot_muncher
- self._gpio = gpio or self.__rpi_gpio__()
+ self._gpio = kwargs.get('gpio') or self.__rpi_gpio__()
self._WR = self._configure(WR)
self._DAT = self._configure(DAT) |
Also the constructor in the suggested fix different: -def __init__(self, gpio=None, width=6, rotate=0, WR=11, DAT=10, CS=8, **kwargs):
+def __init__(self, serial_interface=None, width=6, rotate=0, WR=11, DAT=10, CS=8, **kwargs): |
ah! let me check. That got rid of the error but the demo prints weird characters..
|
If the demo is printing weird characters then that implies the segments on your board are wired up differently, and that we need a different segment mapper that that provided: https://github.com/rm-hull/luma.lcd/blob/master/luma/lcd/segment_mapper.py I remember having to implement a translation layer for the NeoSegments (see https://github.com/rm-hull/luma.led_matrix/blob/master/luma/led_matrix/device.py#L512-L538) - maybe we need something similar here? |
@rm-hull you have a copy of this device as well right? Could you give it a try at some point? |
ps. using suggested code (and not the examples) worked fine for me (only tested numerals though). |
Error when trying the demo:
The text was updated successfully, but these errors were encountered: