mini-led-cube/tools/list2cube.pl

26 lines
584 B
Perl
Raw Normal View History

2013-09-07 22:58:03 +02:00
#!/usr/bin/perl -w
#
# author: Kai Lauterbach (klaute at gmail dot com)
# date: 01/2012
# license: GPL v3
#
2013-09-07 23:48:31 +02:00
use Time::HiRes qw(usleep nanosleep);
2013-09-07 22:58:03 +02:00
my @list = <STDIN>;
my $i = 0;
foreach my $line (@list)
{
chomp $line;
if ($line ne "")
{
my $frame = hex(substr($line,2,8));
print "Adding ". $line. " with ". ($frame >> 27). " delay\n";
2013-09-07 23:48:31 +02:00
my $cframe = $frame & 0x07ffffff;
#printf("0x%08x\n", $cframe);
system("../client/clcc --save --pos $i --delay ". ($frame >> 27)." --frame $cframe");
usleep(250000);
2013-09-07 22:58:03 +02:00
$i++;
}
}