in reply to Re^3: Serial Port
in thread Serial Port
RichardK a big thank you! It works! and the code is below:
Had to use a sub with in a sub...unless there is a different way to do it..the code works as follow:sub handler { my $timer = $mw->repeat(100,\&sighandler ); sub sighandler { my $data = $port->lookfor; return unless $data; # do stuff print STDOUT "$time Message Received: (" . $data . ")\n"; if ($data =~ /OF/) { $signalblock100->configure(-image => $mw->Photo(-file => 'picture.jpg' +)); } $port->lookclear; } }
|
---|