forked from LightsOnHudson/FPP-Plugin-Matrix-Message
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscroll.pl
executable file
·53 lines (40 loc) · 1.93 KB
/
scroll.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/perl
#############################################################################
# PixelOverlay-ScrollingText.pl - Scroll a text string across a matrix
#############################################################################
# Set our library path to find the FPP Perl modules
use lib "/opt/fpp/lib/perl/";
# Use the FPP Memory Map module to talk to the daemon
use FPP::MemoryMap;
#############################################################################
# Setup some variables (this is the part you want to edit for font, color, etc.)
my $name = "RGBMatrix"; # Memory Mapped block name
my $color = "#FF0000"; # Text Color (also names like 'red', 'blue', etc.)
my $fill = "#000000"; # Fill color (not used currently)
my $font = "fixed"; # Font Name
my $size = "16"; # Font size
my $pos = "scroll"; # Position: 'scroll', 'center', 'x,y' (ie, '10,20')
my $dir = "R2L"; # Scroll Direction: 'R2L', 'L2R', 'T2B', 'B2T'
my $pps = 25; # Pixels Per Second
my $msg = "scroll";
#############################################################################
# Main part of program
# Instantiate a new instance of the MemoryMap interface
my $fppmm = new FPP::MemoryMap;
# Open the maps
$fppmm->OpenMaps();
# Get info about the block we are interested in
my $blk = $fppmm->GetBlockInfo($name);
# Clear the block, probably not necessary
$fppmm->SetBlockColor($blk, 0, 0, 0);
# Enable the block (pass 2 for transparent mode, or 3 for transparent RGB)
$fppmm->SetBlockState($blk, 1);
# Scroll the message
$fppmm->TextMessage($blk, $msg, $color, $fill, $font, $size, $pos, $dir, $pps);
# Disable the block
$fppmm->SetBlockState($blk, 0);
# Close the maps (shouldn't make it here with the above "while (1)" loop)
$fppmm->CloseMaps();
# Exit cleanly (shouldn't make it here with the above "while (1)" loop)
exit(0);
#############################################################################