From: Peter Henn Date: Thu, 3 Aug 2017 00:25:01 +0000 (+0000) Subject: Correct and upgrade example files X-Git-Tag: v0.1~3 X-Git-Url: http://git.linex4red.de/pub/pl2303-ft232-gpio.git/commitdiff_plain/8142d08c3350b59c848ecf3dda616b340c815252 Correct and upgrade example files - 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 --- diff --git a/examples/blink.sh b/examples/blink.sh new file mode 100755 index 0000000..0e34b63 --- /dev/null +++ b/examples/blink.sh @@ -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 index 0000000..271fa59 --- /dev/null +++ b/examples/kitt.sh @@ -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 index e2b99b4..0000000 --- a/tests/blink.sh +++ /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 index 6523249..0000000 --- a/tests/kitt.sh +++ /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