hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.67k stars 1.17k forks source link

Is this Chinese P10RGB outdoor module compatible ? #565

Open vegetablesalad opened 6 years ago

vegetablesalad commented 6 years ago

I'm trying to get this module to work, but its jumbled up, I think I have tried every setting. Is it supported or it has some weird mapping I have to transform myself? Just want to check before committing onto remapping.

P10RGB doc PDF

angelogoncalve commented 6 years ago

Try apply this options:

--led-multiplexing=1

or

--led-multiplexing=4 --led-row-addr-type=2

or

--led-multiplexing=5

or

from rgbmatrix import RGBMatrix, RGBMatrixOptions import time

options = RGBMatrixOptions() number_of_panels = 1 MATRIX_ROWS = 16 MATRIX_COLUMNS = 32 options.rows = MATRIX_ROWS / 2 options.cols = MATRIX_COLUMNS options.chain_length = 2 * number_of_panels display = RGBMatrix(options=options) height = display.height width = display.width

def chinese(x, y, red, green, blue):
    scan_rate = MATRIX_ROWS / 4

    xoffset = (MATRIX_COLUMNS / 4) * (x / (MATRIX_COLUMNS / 4))
    yoffset = ((y + scan_rate) % (MATRIX_ROWS / 2)) / scan_rate
    new_x = x + (MATRIX_COLUMNS / 4) * yoffset + xoffset
    new_y = (y % scan_rate) + scan_rate * (y / (MATRIX_ROWS / 2))
    return display.SetPixel(new_x, new_y, red, green, blue)

for x in range(0, width): for y in range(0, height): chinese(x, y, 255, 0, 0) print '({}, {})'.format(x, y) time.sleep(1)

or

from rgbmatrix import RGBMatrix, RGBMatrixOptions import time

options = RGBMatrixOptions() number_of_panels = 1 MATRIX_ROWS = 16 MATRIX_COLUMNS = 32 options.rows = MATRIX_ROWS / 2 options.cols = MATRIX_COLUMNS options.chain_length = 2 * number_of_panels display = RGBMatrix(options=options) height = display.height width = display.width

def chinese2(x, y, red, green, blue):
    scan_rate = MATRIX_ROWS / 4

    odd_quarter = ((y / scan_rate) % 2)
    shift_even_quarter = (1 - odd_quarter) * scan_rate
    shift_odd_quarter = odd_quarter * scan_rate
    new_x = x + ((x + shift_even_quarter) / (MATRIX_COLUMNS / 4)) * (MATRIX_COLUMNS / 4) + shift_odd_quarter
    new_y = (y % scan_rate) + scan_rate * (y / (MATRIX_ROWS / 2))
    return display.SetPixel(new_x, new_y, red, green, blue)

for x in range(0, width): for y in range(0, height): chinese2(x, y, 255, 0, 0) print '({}, {})'.format(x, y) time.sleep(1)

vegetablesalad commented 6 years ago

Thanks, will try this tonight!

hzeller commented 6 years ago

Did it work ? If not, you probably have to go through the datasheet and build a multiplex mapper and possibly send a pull request.

vegetablesalad commented 6 years ago

I managed to get it somewhat close. I'll post my results tonight or later this week.

vegetablesalad commented 6 years ago

Sorry didn't have any free time to work on my project, but just picked it up. So I tried quite a few combinations of settings and your examples, but can't quite get it working. Here are some of the things I tried:

doesn't look like I'm close, this panel must be quite different