Closed aparatowo closed 3 years ago
Hi, I'm struggling with this issue:
No errors throwed.
I have no idea how to build my own script using Luma.
My way of initialisation:
frame_size = (128, 128) spi_config = spi(port=0, device=0, gpio_DC=25, gpio_RST=27, bus_speed_hz=9000000, spi_mode=0b00) display_device = st7735(spi_config, rotate=2, gpio_LIGHT=24, h_offset=1, v_offset=2) display_device.size = frame_size display_device.clear() display_device.show()
Is this way correct?
Find out this already was solved here: https://github.com/rm-hull/luma.lcd/issues/70
Since I know more people with similar problem, the proper way to initiate this screen is:
from luma.core.interface.serial import spi from luma.lcd.device import st7735 from luma.core.render import canvas from time import sleep #need to install pillow as a drop in replacement for discontinued PIL # pip3 install pillow from PIL import Image, ImageDraw frame_size = (128, 128) spi_config = spi(port=0, device=0, gpio_DC=25, gpio_RST=27, bus_speed_hz=16000000) display_device = st7735(spi_config, rotate=2, gpio_LIGHT=24, h_offset=1, v_offset=2, active_low=False, bgr=True) display_device.size = frame_size display_device.clear() base_image = Image.new('RGB', frame_size, 'black') draw = ImageDraw.Draw(base_image) with canvas(display_device) as draw: #this won't work properly #draw.rectangle(display_device.bounding_box, outline="white") draw.rectangle([(0,0), (126,126)], outline="red", width=2) draw.text((10, 40), "Hello World", fill="blue") sleep(4)
Hi, I'm struggling with this issue:
No errors throwed.
I have no idea how to build my own script using Luma.
My way of initialisation:
Is this way correct?
Find out this already was solved here: https://github.com/rm-hull/luma.lcd/issues/70
Since I know more people with similar problem, the proper way to initiate this screen is: