Renamed and random generator added.

This commit is contained in:
Kai Lauterbach 2012-01-14 10:44:35 +01:00
parent c0356d0b46
commit bfefde7938
2 changed files with 48 additions and 0 deletions

View file

@ -1,5 +1,9 @@
#!/usr/bin/perl -w
#
# author: Kai Lauterbach (klaute at gmail dot com)
# date: 01/2012
# license: GPL v3
#
# usage:
#
# ./param2HexFrame.pl "frame 1 data" "frame 2 data" ... "frame N data"

44
tools/genRandomParam.pl Normal file
View file

@ -0,0 +1,44 @@
#!/usr/bin/perl -w
#
# author: Kai Lauterbach (klaute at gmail dot com)
# date: 01/2012
# license: GPL v3
#
#
use strict;
use Time::HiRes qw(usleep nanosleep);
my $odelay = 0;
my $olayer = 0;
my $oled = 0;
print "./param2HexFrame.pl ";
for (my $i = 0; $i < 32; $i++)
{
print "\"";
my $r = 0;
while ($r < 1 || $r > 5 || $odelay == $r)
{
$r = int(rand(6));
}
$odelay = $r;
print $r. ";";
$r = 0;
while ($r < 1 || $r > 3 || $olayer == $r)
{
$r = int(rand(4));
}
$olayer = $r;
print $r;
print ",";
$r = 0;
while ($r < 1 || $r > 9 || $oled == $r)
{
$r = int(rand(10));
}
$oled = $r;
print $r;
print "\" ";
}