use strict; use Win32::API; Win32::API->Import("wsp", "int InitWasp()"); my $read_inputs = Win32::API->new("wsp", "ReadInputs", "P", "I"); InitWasp(); #connect to WASP USB board #constant input read in # while(1){ print ReadInputs()."\n"; sleep(1); } #Subroutines # sub ReadInputs{ my $buf = "\x00" x (4 * 32/8); my $rv = $read_inputs->($buf); return ($rv, unpack('l4', $buf)); }