Comments (13)
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?
Yep!
but I'm not in a position to test this at the moment, could you try it?
Same here, but will do.
We can add it if you like?
Sound good (for newbies).
from luma.examples.
Just refreshing myself with that driver code and noticed your comment - rm-hull/luma.lcd#45 (comment)
Presume you're on python3?
from luma.examples.
Yep.
from luma.examples.
So it looks like the ht1621 doesn't quite conform to the same interface as the other drivers, and because gpio
is marked as a positional argument, but it looks like the cmdline parser passes it as a keyword argument, hence the error you reported.
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?
from luma.examples.
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:
-d ht1621
We can add it if you like?
from luma.examples.
Created #75 for the config file, still need to test the suggested fix for that error.
from luma.examples.
Closed too soon, that PR shouldn't have closed this.
from luma.examples.
@rm-hull tried your fix and getting the same error:
$ python examples/sevensegment_demo.py -d ht1621
Version: luma.lcd 1.0.3 (luma.core 1.2.1)
Display: ht1621
Interface: i2c
Dimensions: 128 x 64
------------------------------------------------------------
/home/rpitest/pi-test/luma.core/luma/core/interface/serial.py:164: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self._gpio.setup(pin, self._gpio.OUT)
Traceback (most recent call last):
File "examples/sevensegment_demo.py", line 121, in <module>
main()
File "examples/sevensegment_demo.py", line 71, in main
device = get_device()
File "/home/rpitest/pi-test/luma.examples/examples/demo_opts.py", line 63, in get_device
device = cmdline.create_device(args)
File "/home/rpitest/pi-test/luma.core/luma/core/cmdline.py", line 176, in create_device
device = Device(spi, **vars(args))
TypeError: __init__() got multiple values for argument 'gpio'
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)
from luma.examples.
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):
from luma.examples.
ah! let me check.
That got rid of the error but the demo prints weird characters..
$ python examples/sevensegment_demo.py -d ht1621
Version: luma.lcd 1.0.3 (luma.core 1.2.1)
Display: ht1621
Interface: i2c
Dimensions: 128 x 64
------------------------------------------------------------
/home/rpitest/pi-test/luma.core/luma/core/interface/serial.py:164: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self._gpio.setup(pin, self._gpio.OUT)
/home/rpitest/pi-test/luma.lcd/luma/lcd/aux.py:36: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self._gpio.setup(self._gpio_LIGHT, self._gpio.OUT)
Simple text...
Digit slicing
from luma.examples.
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?
from luma.examples.
@rm-hull you have a copy of this device as well right? Could you give it a try at some point?
from luma.examples.
ps. using suggested code (and not the examples) worked fine for me (only tested numerals though).
from luma.examples.
Related Issues (20)
- OLED SSD1306 HOT 3
- Can't get these to display correctly - max7129 (x4) HOT 4
- Weather.py not working HOT 1
- ST7735 goes black
- Only some Font Awesome icons seems to work? HOT 1
- How to Easily Present Strings Onto 1.12" Mono OLED (128x128, white/black) Breakout – SPI HOT 3
- ModuleNotFoundError: No module named 'luma' - when using Python 3.9.6 HOT 2
- pygame WARNING, No "Setup" File Exists, Running "buildconfig/config.py" HOT 6
- Error running: sudo -H pip install -e . HOT 1
- --display capture giving an error HOT 9
- Default display driver HOT 3
- Tweepy code HOT 5
- Fix deprecated Pillow Commands HOT 3
- Example IP, Temp, Memory, Disk HOT 3
- Displaying both static and scrolling text HOT 2
- Luma error on orange pi zero 2 HOT 3
- Static noise on oled I2C SH1106 display HOT 5
- Module(s) not found because of wrong installation HOT 3
- ERROR: Could not build wheels for pillow which use PEP 517 and cannot be installed directly HOT 2
- Pi Zero 2 W, cannot open resource HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luma.examples.