File: flash.pl

package info (click to toggle)
libhipi-perl 0.93-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,048 kB
  • sloc: perl: 471,917; ansic: 22; makefile: 10
file content (38 lines) | stat: -rwxr-xr-x 699 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl
use strict;
use warnings;

use HiPi::Interface::MicroDotPHAT;

my $phat = HiPi::Interface::MicroDotPHAT->new();

print q(Flash
Flashes all the elements.
Press Ctrl+C to exit.
);

my $speed = 5;
my @strings = ("One", "Two", "Three", "Four");
my $string = 0;
my $shown = 1;
$phat->show();

my $t = 500;

while(1) {
    $phat->clear();
    $phat->show();
    $phat->sleep_milliseconds( $t );
    for(my $x = 0; $x < $phat->width; $x ++) {
        for (my $y = 0; $y < $phat->height; $y ++) {
            $phat->set_pixel($x,$y,1);
        }
    }
    for (my $x = 0; $x < 6; $x++ ) {
        $phat->set_decimal($x,1);
    }
    $phat->show();
    $phat->sleep_milliseconds( $t );
}

1;