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.64k stars 1.16k forks source link

Examples not showing #590

Open ashleebeggs opened 6 years ago

ashleebeggs commented 6 years ago

Hi, I have one 32x16 panel with raspberry pi 3 and adafruit RGB RTC hat. I followed the instructions and tried running demo 1 and 3. Both show the panel split in half with blue and purple. I'm using a 5v 4A power supply plugged into the hat while the micro usb is plugged into the pi.

I'm not sure where to look for the issue. I'm not getting any errors either

Is there something I'm missing? Thanks!   img_4649

ashleebeggs commented 6 years ago

I run sudo ./demo -D 3 --led-gpio-mapping=adafuit-hat --led-rows=16

angelogoncalve commented 6 years ago

Try this in python:

from rgbmatrix import RGBMatrix, RGBMatrixOptions import time

number_of_rows = 16 number_of_panels = 1 parallel = 1 number_of_columns = 32

def rgbmatrix_options(): options = RGBMatrixOptions() options.multiplexing = 0 options.row_address_type = 0 options.brightness = 100 options.rows = number_of_rows options.cols = number_of_columns options.chain_length = number_of_panels options.parallel = parallel options.hardware_mapping = 'adafruit-hat' options.inverse_colors = False options.led_rgb_sequence = "RGB" options.gpio_slowdown = 4 options.pwm_lsb_nanoseconds = 130 options.show_refresh_rate = 0 options.disable_hardware_pulsing = True options.scan_mode = 1 options.pwm_bits = 1 options.daemon = 0 options.drop_privileges = 0 options.pixel_mapper_config = "U-mapper;Rotate:0" options.pwm_dither_bits = 0 return RGBMatrix(options=options)

display = rgbmatrix_options()

height = display.height width = display.width

print ('width={}, height={}'.format(width, height))

class Point: def init(self, x, y): self.x = x self.y = y

def __repr__(self):
    return '({}, {})'.format(self.x, self.y)

for x in range(0, width): for y in range(0, height): display.SetPixel(x, y, 0, 255, 0) point = Point(x, y) print point time.sleep(1)

ashleebeggs commented 6 years ago

Thanks for the response! I'm new to the pi and I'm not quite sure where to put the code. Is there an existing file I should add or edit this to?

Thanks

angelogoncalve commented 6 years ago

Yes, first create a .py file name and put the code with the correct indentation, use for example a python editor named PyCharm software that runs in Windows operating system computer, or you can use the Python2 compiler that comes in Debian operating system from raspberry.

Then in the command line use the command:

sudo python name_file.py