me8100_test_perl/test.pl
changeset 29 1ad7e54c3dc4
parent 28 df25c194e3ce
child 31 33280ad0f4b2
--- a/me8100_test_perl/test.pl	Sat Jan 26 19:46:15 2002 +0100
+++ b/me8100_test_perl/test.pl	Mon Jan 28 16:33:37 2002 +0100
@@ -3,15 +3,22 @@
 use ME8100;
 
 my @DEVICES = qw(/dev/me8100_0a /dev/me8100_0b);
+my @INPUTS = qw(Tür1 Tür2 Feuerlöscher);
+
 
 MAIN: {
     my $me8100 = new ME8100(@DEVICES);
+    my %inputs;
 
-    while (1) { 
-	my @a = $me8100->read();    # should block
-	print "** <@a> **\n";
-	sleep(1000);
-    }
+    # first read will be always go through
+    @inputs{@INPUTS} = $me8100->read();
+    print "Read:\n";
+    print map { sprintf "%20s: %d\n", $_, $inputs{$_} } @INPUTS;
+
+    @inputs{@INPUTS} = $me8100->status();
+    print "Status:\n";
+    print map { sprintf "%20s: %d\n", $_, $inputs{$_} } @INPUTS;
+
 
 }