RGB Matrix LED Python PIL height

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Lupin3000
 
Posts: 6
Joined: Sun Nov 14, 2021 8:52 am

RGB Matrix LED Python PIL height

Post by Lupin3000 »

I have a Raspberry Pi Zero, a Adafruit RGB Matrix HAT and a 64x32 RGB Matrix LED. I use Python to create content on LED. If I try to use a height < 16 it does not work!

Code: Select all

#! /usr/bin/env python

import time
from PIL import Image, ImageDraw
from rgbmatrix import RGBMatrix, RGBMatrixOptions

options = RGBMatrixOptions()
options.chain_length = 2
options.cols = 32
options.rows = 64
options.parallel = 1
options.brightness = 100
options.disable_hardware_pulsing = True
options.drop_privileges = 1
options.gpio_slowdown = 1
options.hardware_mapping = 'adafruit-hat'
options.inverse_colors = False
options.led_rgb_sequence = "RGB"
options.multiplexing = 0
options.pixel_mapper_config = ''
options.pwm_bits = 11
options.pwm_dither_bits = 0
options.pwm_lsb_nanoseconds = 130
options.row_address_type = 0
options.scan_mode = 0
options.show_refresh_rate = False

matrix = RGBMatrix(options=options)
image = Image.new("RGB", size=(64, 32))
draw = ImageDraw.Draw(image)

draw.rectangle((0, 0, 63, 31), fill=(0, 0, 0), outline=(0, 0, 255)) # here max is always 16!!!!!! all values higher get ignored (like 31)
draw.rectangle((2, 2, 61, 13), fill=(0, 0, 0), outline=(255, 0, 0))

matrix.Clear()
matrix.SetImage(image)
time.sleep(10)
matrix.Clear()


The issue is that all height values (greater 16) are ignored!!!! Does someone see my issue and can share some help?

Note: the picture shows that the blue rectangle is max. 16
Attachments
rgb_matrix_example.jpg
rgb_matrix_example.jpg (292.01 KiB) Viewed 403 times

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RGB Matrix LED Python PIL height

Post by mikeysklar »

"chain_length" is also set to '2', but you only have one display.

Your script seems backwards with the row/column values. Isn't this a 64 column x 32 row display?

Did you run the rgb-matrix.sh installer script? Then try the demo?

Code: Select all

sudo ./demo -D0 --led-rows=32 --led-cols=64

User avatar
Lupin3000
 
Posts: 6
Joined: Sun Nov 14, 2021 8:52 am

Re: RGB Matrix LED Python PIL height

Post by Lupin3000 »

Thank you so much for the hint! Now it works!!!! Yes I do have LED Matrix with 64 column x 32 row display.

The idea of options.chain_length = 1 brought the result that I had 2 rectangles. Same if I start the example "sudo ./demo -D0 --led-rows=32 --led-cols=64"

Code: Select all

options.chain_length = 2
options.cols = 32
options.rows = 32
Again thank you mikeysklar!!!!!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RGB Matrix LED Python PIL height

Post by mikeysklar »

Good work. Thank you for the followup.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”