def __init__(self, config): from rgbmatrix import RGBMatrix, RGBMatrixOptions options = RGBMatrixOptions() options.rows = config.getint('rows') options.cols = config.getint('cols') options.hardware_mapping = config['led_hardware_mapping'] options.chain_length = config.getint('led_chain') options.parallel = config.getint('led_parallel') options.pwm_bits = config.getint('led_pwm_bits') options.brightness = config.getint('led_brightness') options.pwm_lsb_nanoseconds = config.getint('led_pwm_lsb_nanoseconds') options.inverse_colors = config.getboolean('led_inverse') options.led_rgb_sequence = config['led_rgb_sequence'] options.pixel_mapper_config = config['led_pixel_mapper'] options.row_address_type = config.getint('led_row_addr_type') options.multiplexing = config.getint('led_multiplexing') options.scan_mode = config.getint('led_scan_mode') options.gpio_slowdown = config.getint('led_slowdown_gpio') options.disable_hardware_pulsing = config.getboolean( 'led_no_hardware_pulse') options.show_refresh_rate = config.getboolean('led_show_refresh') options.pwm_dither_bits = config.getint('led_pwm_dither_bits') #options.panel_type = config['led_panel_type'] self.matrix = RGBMatrix(options=options) self.offscreen_canvas = self.matrix.CreateFrameCanvas()
def cli(ctx, verbose, home, rows, chain_length, parallel, brightness, gpio_slowdown, pwm_lsb_nanoseconds, scan_mode, hardware_mapping): """Blinky Matrix Display Driver""" ctx.verbose = verbose if home is not None: ctx.home = home # Configuration for the matrix options = RGBMatrixOptions() options.rows = rows ctx.vlog(click.style(f"rows = {options.rows}", fg="yellow")) options.chain_length = chain_length ctx.vlog(click.style(f"chain_length = {options.chain_length}", fg="yellow")) options.parallel = parallel ctx.vlog(click.style(f"parallel = {options.parallel}", fg="yellow")) options.brightness = brightness ctx.vlog(click.style(f"brightness = {options.brightness}", fg="yellow")) options.gpio_slowdown = gpio_slowdown ctx.vlog(click.style(f"gpio_slowdown = {options.gpio_slowdown}", fg="yellow")) options.pwm_lsb_nanoseconds = pwm_lsb_nanoseconds ctx.vlog(click.style(f"pwm_lsb_nanoseconds = {options.pwm_lsb_nanoseconds}", fg="yellow")) options.scan_mode = scan_mode ctx.vlog(click.style(f"scan_mode = {options.scan_mode}", fg="yellow")) options.hardware_mapping = hardware_mapping ctx.vlog(click.style(f"hardware_mapping = {options.hardware_mapping}", fg="yellow")) ctx.matrix = RGBMatrix(options = options) ctx.vlog(click.style(f"home = {ctx.home}", fg="yellow"))
def getOptions(self): options = RGBMatrixOptions() options.hardware_mapping = "regular" options.rows = 16 options.cols = 32 options.chain_length = 1 options.parallel = 1 options.row_address_type = 0 options.multiplexing = 0 options.pwm_bits = 11 options.brightness = 50 options.pwm_lsb_nanoseconds = 130 options.led_rgb_sequence = "RGB" options.show_refresh_rate = 0 options.gpio_slowdown = 4 options.disable_hardware_pulsing = False options.scan_mode = 1 return options
def rgbmatrix_options(): options = RGBMatrixOptions() options.multiplexing = 6 options.row_address_type = 0 options.brightness = 80 options.rows = number_of_rows_per_panel options.cols = number_of_columns_per_panel options.chain_length = number_of_panels options.parallel = parallel options.hardware_mapping = 'regular' options.inverse_colors = False options.led_rgb_sequence = "BGR" options.gpio_slowdown = 1 options.pwm_lsb_nanoseconds = 130 options.show_refresh_rate = 0 options.disable_hardware_pulsing = False options.scan_mode = 0 options.pwm_bits = 11 options.daemon = 0 options.drop_privileges = 0 return options
def rgbmatrix_options(): options = RGBMatrixOptions() options.multiplexing = 0 options.row_address_type = 0 options.brightness = 100 options.rows = led_panel_height options.cols = led_panel_width options.chain_length = 1 options.parallel = 1 options.hardware_mapping = 'regular' options.inverse_colors = False options.led_rgb_sequence = "RGB" options.gpio_slowdown = 3 options.pwm_lsb_nanoseconds = 150 options.show_refresh_rate = 0 options.disable_hardware_pulsing = True options.scan_mode = 0 options.pwm_bits = 11 options.daemon = 0 options.drop_privileges = 0 return options
def rgbmatrix_options(): options = RGBMatrixOptions() options.multiplexing = 1 options.row_address_type = 0 options.brightness = 60 options.rows = 64 options.cols = 64 options.chain_length = 1 options.parallel = 1 options.hardware_mapping = 'regular' options.inverse_colors = False options.led_rgb_sequence = "GBR" options.gpio_slowdown = 4 options.pwm_lsb_nanoseconds = 50 options.show_refresh_rate = 1 options.disable_hardware_pulsing = False options.scan_mode = 1 options.pwm_bits = 11 # options.daemon = 0 # options.drop_privileges = 0 # options.pixel_mapper_config = "U-mapper;Rotate:90" options.pixel_mapper_config = "Rotate:90" return RGBMatrix(options=options)
import time import datetime import numpy as np import scipy.misc as misc from rgbmatrix import RGBMatrix, RGBMatrixOptions dir_path = os.path.dirname(os.path.realpath(__file__)) options = RGBMatrixOptions() options.rows = 32 options.chain_length = 1 options.parallel = 1 options.hardware_mapping = 'adafruit-hat-pwm' options.multiplexing = 1 options.pwm_bits = 8 options.scan_mode = 0 options.gpio_slowdown = 1 options.pwm_lsb_nanoseconds = 260 #options.show_refresh_rate = 1 #options.daemon = 1 runthrough_min = 10 matrix = RGBMatrix(options=options) radius = 12 * 10 start = 160 - radius diameter = radius * 2 color = (88, 88, 88) dimen = 320 #moonColors = [(255,196,23),(255,216,99)]