HowTo: pxlBlck – Configure and display animations

You can use the pxlBlck to be informed about events in various ways. One of these options is to display previously set icons.

Unfortunately, this option only works on LED matrices with a height greater than one, i.e. not on the pxlBlcks which "only" use an LED strip or a 1×60 LED matrix.

Therefore, in addition to the option of displaying icons, there is also the option of displaying animations. These animations work on all LED matrices supported by the pxlBlck plug-in.


Animation basics

Animations can only be displayed using the correct command. This means that they are only executed on an event-related basis.

For example, you can trigger an animation when a certain message is sent to the pxlBlck via MQTT, a connected sensor has assumed a certain state, but also, for example, when the pxlBlck has started or has lost the connection to the WLAN. I will collect a few examples of this under the tag pxlBlckUsecase. You can find a list of these use cases under https://nerdiy.de/tag/pxlblckusecase/

Here are a few basics on the basic structure of the command for triggering animations on the pxlBlck. How you can send this command to the pxlBlck is also described in the article ESPEasy - Execute commands and actions via HTTP, MQTT, UDP and directly described. Basic information on the structure of the pxlBlck commands can also be found in this article pxlBlck - Commands for configuring the pxlBlck

Command name

pbani

Command overview

pbani,[animation_type 1-6],[color_on_red 0-255],[color_on_green 0-255],[color_on_blue 0-255],[color_off_red 0-255],[color_off_green 0-255],[color_off_blue 0-255],[animation_delay 0-500],

Parameter description

Parameter nameDescriptionPermitted value range
animation_typeThis parameter defines the type of animation. An overview of the possible animations can be found in the following table.1-6
color_on_redThis parameter determines the brightness of the red color in the input animation.0-255
color_on_greenThis parameter determines the brightness of the green color in the input animation.0-255
color_on_blueThis parameter determines the brightness of the blue color in the input animation.0-255
color_off_redThis parameter determines the brightness of the red color in the output animation.0-255
color_off_greenThis parameter determines the brightness of the green color in the output animation.0-255
color_off_blueThis parameter determines the brightness of the blue color in the output animation.0-255
animation_delayHere you can set the duration of the animation. It is specified in milliseconds and describes the display duration per pixel.0-500

Overview of the animations

IDDescription
1The LED matrix is filled from the right with the input color and then overwritten to the left with the output color.
2The LED matrix is filled from the left with the input color and then overwritten to the right with the output color.
3A vertical line (in input color) moves from left to right (in output color).
4A vertical line (in output color) moves from left to right (in input color).
5The LED matrix is filled from both sides towards the mtte and then dissolved again.
6The LED matrix is filled from the center and then dissolved again.

Information on implementation

The execution of animations is implemented in such a way that no other tasks can be performed while the animation is being displayed. As a result, loading the pxlBlck web menu, for example, cannot be continued while an animation is being displayed. In addition, no other commands are processed while the animation is running. However, these should be executed after the animation has finished.


"Cooldown time"

The processing of animations is time-limited. This means that after receiving a command to display an animation, the pxlBlck ignores further commands to display animations for a certain time.

This time period is defined in the source code and cannot be changed during operation. If you want to change it: It is defined with the #define PXLBLCK_ANIMATION_COOLDOWN_TIME.


Examples

The following paragraph lists a few example commands and their view on the various pxlBlcks.


Info:

  • Animation type: 1
  • Delay: 50ms
  • Input color (RGB value): 150,0,0
  • Output color (RGB value): 0,0,150

Command:

pbani,1,150,0,0,0,0,150,50


Info:

  • Animation type: 2
  • Delay: 50ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,50,0

Command:

pbani,2,50,50,50,0,0,50,50,


Info:

  • Animation type: 3
  • Delay: 150ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,50,0

Command:

pbani,3,50,50,50,0,50,0,150,


Info:

  • Animation type: 4
  • Delay: 50ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,50,0

Command:

pbani,4,50,50,50,0,50,0,50,


Info:

  • Animation type: 5
  • Delay: 50ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,0,50

Command:

pbani,5,50,50,50,0,0,50,50,


Info:

  • Animation type: 6
  • Delay: 20ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,50,0

Command:

pbani,6,50,50,50,0,50,0,50,


Info:

  • Animation type: 5
  • Delay: 20ms (20ms is the default delay used if this parameter is set to zero)
  • Input color (RGB value): 150,0,0
  • Output color (RGB value): 0,0,0

Command:

pbani,5,150,0,0,0,0,0,


Info:

  • Animation type: 1
  • Delay: 20ms (20ms is the default delay used if this parameter is set to zero)
  • Input color (RGB value): 100,100,100
  • Output color (RGB value): 0,0,0

Command:

pbani,1,100,100,100,0,0,0,


Info:

  • Animation type: 1
  • Delay: 50ms
  • Input color (RGB value): 150,0,0
  • Output color (RGB value): 0,0,150

Command:

pbani,1,150,0,0,0,0,150,50


Info:

  • Animation type: 3
  • Delay: 150ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,50,0

Command:

pbani,3,50,50,50,0,50,0,150


Info:

  • Animation type: 4
  • Delay: 50ms
  • Input color (RGB value): 50,50,50
  • Output color (RGB value): 0,50,0

Command:

pbani,4,50,50,50,0,50,0,50


Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.