#!/usr/local/bin/perl -w use Device::SerialPort; use strict; $|=1; my %ergoCommands; ## initialize serial port my $portname="/dev/ttyS0"; my $port = new Device::SerialPort ($portname); $port->user_msg("ON"); $port->databits(8); $port->baudrate(4800); $port->parity("none"); $port->stopbits(1); $port->handshake("xoff"); $port->write_settings() || undef $port; my $count_out = $port->write("\x40\x0"); warn "command failed:$_[0]\n" unless ($count_out eq length($cmddata)); ## I don't want to go asleep :( ##sleep(1); ## hmm.. does not block ($real_in, $data_in) = $port->read(17);