From: Dobrica Pavlinusic Date: Fri, 17 Jun 2016 08:08:31 +0000 (+0200) Subject: dump pins without wiringpi mappings but with pcf8591 X-Git-Url: http://git.rot13.org/?p=x300-pci;a=commitdiff_plain;h=9881b2479f459d85b4f0ef42c8f986bddd49935f dump pins without wiringpi mappings but with pcf8591 --- diff --git a/gpio.pl b/gpio.pl new file mode 100755 index 0000000..9b97bc5 --- /dev/null +++ b/gpio.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +my @last; + +while(1) { + +my @o; +my @pcf = `gpio -x pcf8591:120:0x48 readall`; +my @gpio = `gpio -g readall`; +foreach (@gpio) { + chomp; +# next unless /\d\s/; + + # kill wiringpi mapping columns + s/^(.{8}).{6}/$1/; + s/.{6}(.{8})$/$1/; + + s/([ \d]{2})(...GPIO.)../$1$2$1/; + s/(GPIO.)..(...)(\s*\d+)/$1$3$2$3/; + + push @o, $_; + print $_, shift @pcf || "\n"; +} + +my $cmd = ; + +} #/while +