19. Plugins I use Win32::SerialPort; my $port = 'COM3'; my $baud = 9600; my $parity = 'none'; my $data = 2; my $stop = 1; my $handshake = 'none'; sub new { bless {}, shift; }
20. Plugins I my $conn = Win32::SerialPort->new( $port ) or die $^E; $conn->databits( $data ); $conn->baudrate( $baud ); $conn->parity( $parity ); $conn->stopbits( $stop ); while ( 1 ) { my $char = $conn->lookfor; no warnings 'numeric'; # read input from usb port # if “1” is returned, start alarm $conn->lookclear; }