Personal tools

Difference between revisions of "BuZz/Stitch ledbar perlscript"

From Eth0Wiki

Jump to: navigation, search
(Created page with '#!/usr/bin/perl use Device::SerialPort; use Time::HiRes qw(usleep); $port = Device::SerialPort->new("/dev/ttyUSB0"); if (!$port) { print "ttyUSB0 unopenable\n"; exit; } $po…')
 
 
Line 1: Line 1:
 +
<pre>
 
#!/usr/bin/perl
 
#!/usr/bin/perl
  
Line 21: Line 22:
  
 
my $count_out = $port->write($command);
 
my $count_out = $port->write($command);
 +
 +
 +
</pre>

Latest revision as of 20:28, 15 January 2011

#!/usr/bin/perl

use Device::SerialPort;
use Time::HiRes qw(usleep);

$port = Device::SerialPort->new("/dev/ttyUSB0");
if (!$port) { 
	print "ttyUSB0 unopenable\n";
	exit;
}

$port->databits(8);
$port->baudrate(9600);
$port->parity("none");
$port->stopbits(1);

# my $text = "<D*>";   # dit is alles wissen
my $text = "<PA><CA>--<CB>=<CC>[<CM> 21:30-22:30 get drunk on the cheap, hacky hour; 1 grolsch = just 3 tokens <CC>]<CB>=<CA>--  ";  # leuk regeltje tekst

my $command = "<ID01>".$text.chr(13).chr(10);

my $count_out = $port->write($command);