opensign
¶
A library to facilitate easy RGB Matrix Sign Animations.
- Author(s): Melissa LeBlanc-Williams
Implementation Notes¶
Software and Dependencies:
- Henner Zeller RGB Matrix Library: https://github.com/hzeller/rpi-rgb-led-matrix
- Python Imaging Library (Pillow)
-
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
(canvas, count=3, duration=1)¶ Blink the foreground on and off a centain number of times over a certain period of time.
Parameters:
-
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:
-
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:
-
flash
(canvas, count=3, duration=1)¶ Fade the foreground in and out a centain number of times over a certain period of time.
Parameters:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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
-