Comments (5)
So I got it to work as I wanted, this how I solved it
import atexit, time
from luma.core.render import canvas
from luma.core.interface.serial import spi, gpio_cs_spi
from luma.oled.device import ssd1306
import RPi.GPIO as GPIO
cs_pins = [16, 26, 19, 13, 12]
serials = [gpio_cs_spi(device=0, port=0, gpio_CS=cs) for cs in cs_pins]
devices = [ssd1306(serials[i], height=32, rotate=0) for i, _ in enumerate(cs_pins)]
def cleanup():
for device in devices:
device.clear()
GPIO.cleanup()
atexit.register(cleanup)
for i, device in enumerate(devices, start=1):
with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline="white", fill="black")
draw.text((10, 10), f"DISPLAY {i}", fill="white")
while True:
time.sleep(0.1)
from luma.oled.
Why do you use GPIO.output(pin, GPIO.LOW if j == i else GPIO.HIGH)
?
from luma.oled.
@thijstriemstra Without that all the displays are looping "Display 1", "Display 2" etc all the time (they are all showing the same text)... But without it I get text on the first four displays after a restart of the program...
from luma.oled.
I wouldn't 'manually' try to change the gpio pins that luma.oled manages, unless there's a really good reason (e.g bugfix). This sounds to me like it's a coding issue (I want to show X) rather than an issue with luma.oled?
But without it I get text on the first four displays after a restart of the program...
Maybe do the cleear of the screens in the cleanup instead, e.g.
def cleanup():
for device in devices:
device.clear()
GPIO.cleanup()
atexit.register(cleanup)
Or do a cleanup of the CS pins manually instead of using GPIO.cleanup()
?
Also: try different/default SPI bus speeds..
from luma.oled.
I agree, I'm pretty sure the problem is my code. The change to the cleanup fixed the restart issue. Removed the bus_speed but still have same text on all displays (or actually only on four out of five).
I have also experimented with code from here #311 but didn't get the gpio_cs_spi
to work
All help is greatly appreciated
from luma.oled.
Related Issues (20)
- [question] access screens on remote Pi?
- Support for non-Raspberry Pi Linux boards HOT 1
- New Haven 2.7 oled with ssd1322 HOT 4
- ImportError: The _imagingft C module is not installed HOT 1
- White display SPI issue with 6.x kernels HOT 2
- Array is incorrectly shifted for 96x16 OLEDs. HOT 5
- Scrolling text within bounding box
- Input/output error for luma.oled HOT 6
- sys_info.py: error: I2C device not found on address: 0x3C.But i2c can detected on pi 4b arm64
- Low FPS on SSD1322 and Raspberry Pi 3B HOT 1
- Orange Pi zero2 error Timer expired HOT 2
- Wrong column offset 1.54" SH1106 I2C HOT 6
- Hardware Accelerated 3D on the SSD1306
- from oled.device import ssd1306, sh1106 ModuleNotFoundError: No module named 'oled' HOT 7
- ImportError: cannot import name 'sh1107' from 'luma.oled.device' HOT 1
- Incremental screen updates with Luma and SH1106? HOT 1
- Semi-random pixels on SSD1322 - how to fix? HOT 4
- Support to display latin characters HOT 1
- luma.oled - device on SPI fails with BOOKWORM 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.oled.