Correct and upgrade example files
authorPeter Henn <Peter.Henn@web.de>
Thu, 3 Aug 2017 00:25:01 +0000 (00:25 +0000)
committerPeter Henn <Peter.Henn@web.de>
Thu, 3 Aug 2017 00:25:01 +0000 (00:25 +0000)
- remove unneeded sudo from blink example
- add 2nd GPIO to bink example
- allow flexible change of GPIO number in blink example
- make gpio program more flexible in both examples
- more cosmetic changes
- rename test directory into examples

examples/blink.sh [new file with mode: 0755]
examples/kitt.sh [new file with mode: 0755]
tests/blink.sh [deleted file]
tests/kitt.sh [deleted file]

diff --git a/examples/blink.sh b/examples/blink.sh
new file mode 100755 (executable)
index 0000000..0e34b63
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+GPIOTOOL=ft232rgpio
+GPIOA=2
+GPIOB=3
+while true; do
+    $GPIOTOOL --gpio=$GPIOA --out 0 --gpio=$GPIOB --out 0
+    sleep 0.3
+    $GPIOTOOL --gpio=$GPIOA --out 1
+    sleep 0.3
+    $GPIOTOOL --gpio=$GPIOA --out 0 --gpio=$GPIOB --out 1
+    sleep 0.3
+    $GPIOTOOL --gpio=$GPIOA --out 1
+    sleep 1
+done
diff --git a/examples/kitt.sh b/examples/kitt.sh
new file mode 100755 (executable)
index 0000000..271fa59
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+GPIOTOOL=cp2103gpio
+while true; do
+    $GPIOTOOL --gpio=0 --out 1 --gpio 1 --out 0 --sleep 300
+    $GPIOTOOL --gpio=1 --out 1 --gpio 2 --out 0 --sleep 300
+    $GPIOTOOL --gpio=2 --out 1 --gpio 1 --out 0 --sleep 300
+    $GPIOTOOL --gpio=1 --out 1 --gpio 0 --out 0 --sleep 300
+done
diff --git a/tests/blink.sh b/tests/blink.sh
deleted file mode 100755 (executable)
index e2b99b4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-while true; do 
-sudo ./cp2103gpio --gpio=0 --out 0
-sleep 0.3
-sudo ./cp2103gpio --gpio=0 --out 1
-sleep 0.3
-sudo ./cp2103gpio --gpio=0 --out 0
-sleep 0.3
-sudo ./cp2103gpio --gpio=0 --out 1
-sleep 1
-done
diff --git a/tests/kitt.sh b/tests/kitt.sh
deleted file mode 100755 (executable)
index 6523249..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-while true; do 
-./cp2103gpio --gpio=0 --out 1 --gpio 1 --out 0 --sleep 300
-./cp2103gpio --gpio=1 --out 1 --gpio 2 --out 0 --sleep 300
-./cp2103gpio --gpio=2 --out 1 --gpio 1 --out 0 --sleep 300
-./cp2103gpio --gpio=1 --out 1 --gpio 0 --out 0 --sleep 300
-
-
-
-
-
-done