projects
/
x300-pci
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9881b24
)
add toggle pin
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 17 Jun 2016 08:33:33 +0000
(10:33 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 17 Jun 2016 08:34:01 +0000
(10:34 +0200)
gpio.pl
patch
|
blob
|
history
diff --git
a/gpio.pl
b/gpio.pl
index
9b97bc5
..
95425a3
100755
(executable)
--- a/
gpio.pl
+++ b/
gpio.pl
@@
-23,6
+23,14
@@
foreach (@gpio) {
}
my $cmd = <STDIN>;
+chomp $cmd;
+if ( $cmd =~ m/^(\d+)$/ ) {
+ my $v = `gpio -g read $1`;
+ warn "# pin $1 ", $v;
+ $v ^= 1;
+ system "gpio -g write $1 $v";
+}
+
} #/while