opensign

A library to facilitate easy RGB Matrix Sign Animations.

  • Author(s): Melissa LeBlanc-Williams

Implementation Notes

Software and Dependencies:

class opensign.OpenSign(*, rows=16, columns=32, chain=1, brightness=100, gpio_mapping='adafruit-hat', parallel=1, pwm_bits=11, panel_type='', rgb_sequence='rgb', show_refresh=False, slowdown_gpio=None, no_hardware_pulse=False, pwm_lsb_nanoseconds=130, row_addr_type=0, multiplexing=0, pixel_mapper='')

Main class that controls the sign and graphics effects.

Blink the foreground on and off a centain number of times over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • count (float) – (optional) The number of times to blink. (default=3)
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
fade_in(canvas, duration=1, steps=50)

Fade the foreground in over a certain period of time by a certain number of steps. More steps is smoother, but too high of a number may slow down the animation too much.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
  • steps (float) – (optional) The number of steps to perform the animation. (default=50)
fade_out(canvas, duration=1, steps=50)

Fade the foreground out over a certain period of time by a certain number of steps. More steps is smoother, but too high of a number may slow down the animation too much.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
  • steps (float) – (optional) The number of steps to perform the animation. (default=50)
flash(canvas, count=3, duration=1)

Fade the foreground in and out a centain number of times over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • count (float) – (optional) The number of times to flash. (default=3)
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
height

Returns the height in pixels

hide(canvas)

Hide the canvas at its current position.

Parameters:canvas (OpenSignCanvas) – The canvas to hide.
join_in_horizontally(canvas, duration=0.5)

Show the effect of a split canvas joining horizontally over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over. (default=0.5)
join_in_vertically(canvas, duration=0.5)

Show the effect of a split canvas joining vertically over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over. (default=0.5)
loop_down(canvas, duration=0.5, count=1)

Loop a canvas towards the bottom side of the display over a certain period of time by a certain number of times. The canvas will re-enter from the top and end up back a the starting position.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • count (float) – (optional) The number of times to loop. (default=1)
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
loop_left(canvas, duration=1, count=1)

Loop a canvas towards the left side of the display over a certain period of time by a certain number of times. The canvas will re-enter from the right and end up back a the starting position.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • count (float) – (optional) The number of times to loop. (default=1)
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
loop_right(canvas, duration=1, count=1)

Loop a canvas towards the right side of the display over a certain period of time by a certain number of times. The canvas will re-enter from the left and end up back a the starting position.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • count (float) – (optional) The number of times to loop. (default=1)
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
loop_up(canvas, duration=0.5, count=1)

Loop a canvas towards the top side of the display over a certain period of time by a certain number of times. The canvas will re-enter from the bottom and end up back a the starting position.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • count (float) – (optional) The number of times to loop. (default=1)
  • duration (float) – (optional) The period of time to perform the animation over. (default=1)
scroll_from_to(canvas, duration, start_x, start_y, end_x, end_y)

Scroll the canvas from one position to another over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – The period of time to perform the animation over in seconds.
  • start_x (int) – The Starting X Position
  • start_yx (int) – The Starting Y Position
  • end_x (int) – The Ending X Position
  • end_y (int) – The Ending Y Position
scroll_in_from_bottom(canvas, duration=1, y=0)

Scroll a canvas in from the bottom side of the display over a certain period of time. The final position is centered.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
  • y (int) – (optional) The amount of y-offset from the center position (default=0)
scroll_in_from_left(canvas, duration=1, x=0)

Scroll a canvas in from the left side of the display over a certain period of time. The final position is centered.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
  • x (int) – (optional) The amount of x-offset from the center position (default=0)
scroll_in_from_right(canvas, duration=1, x=0)

Scroll a canvas in from the right side of the display over a certain period of time. The final position is centered.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
  • x (int) – (optional) The amount of x-offset from the center position (default=0)
scroll_in_from_top(canvas, duration=1, y=0)

Scroll a canvas in from the top side of the display over a certain period of time. The final position is centered.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
  • y (int) – (optional) The amount of y-offset from the center position (default=0)
scroll_out_to_bottom(canvas, duration=1)

Scroll a canvas off the display from its current position towards the bottom over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
scroll_out_to_left(canvas, duration=1)

Scroll a canvas off the display from its current position towards the left over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
scroll_out_to_right(canvas, duration=1)

Scroll a canvas off the display from its current position towards the right over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
scroll_out_to_top(canvas, duration=1)

Scroll a canvas off the display from its current position towards the top over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over in seconds. (default=1)
set_background_color(color)

Sets the background to a solid color. The color should be a 3 or 4 value tuple or list or an hexidecimal value in the format of 0xRRGGBB.

Parameters:color (tuple or list or int) – The time to sleep in seconds.
set_background_image(file)

Sets the background to an image

Parameters:file (string) – The file location of the image to display.
set_position(canvas, x=0, y=0)

Instantly move the canvas to a specific location. (0, 0) is the top-left corner.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to move.
  • x (int) – (optional) The x-position to move the canvas to. (default=0)
  • y (int) – (optional) The y-position to move the canvas to. (default=0)
show(canvas)

Show the canvas at its current position.

Parameters:canvas (OpenSignCanvas) – The canvas to show.
split_out_horizontally(canvas, duration=0.5)

Show the effect of a canvas splitting horizontally over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over. (default=0.5)
split_out_vertically(canvas, duration=0.5)

Show the effect of a canvas splitting vertically over a certain period of time.

Parameters:
  • canvas (OpenSignCanvas) – The canvas to animate.
  • duration (float) – (optional) The period of time to perform the animation over. (default=0.5)
width

Returns the width in pixels