git.ucc.asn.au
/
matches
/
honours.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Automatic commit. Wed Sep 19 12:00:12 WST 2012
[matches/honours.git]
/
research
/
TCS
/
pressure
/
get_pressure.sh
diff --git
a/research/TCS/pressure/get_pressure.sh
b/research/TCS/pressure/get_pressure.sh
index
55c4fdf
..
f7aa8b5
100755
(executable)
--- a/
research/TCS/pressure/get_pressure.sh
+++ b/
research/TCS/pressure/get_pressure.sh
@@
-7,13
+7,26
@@
process_digits=/home/sam/Documents/University/honours/research/TCS/pressure/proc
mkdir -p $imgdir 2>/dev/null
name=$(date +%F-%H%M%S.jpg)
mkdir -p $imgdir 2>/dev/null
name=$(date +%F-%H%M%S.jpg)
-fswebcam --device /dev/video1 -r 640x480 --jpeg 85 $imgdir/$name 2>/dev/null
+fswebcam --device /dev/video0 -r 640x480 --jpeg 85 $imgdir/$name 2>/dev/null # NOTE: Need to make sure we use the right /dev/videoX
+ # Otherwise images may come from the laptop's shitty inbuilt webcam
+
$get_digits $imgdir/$name $imgdir/$name 2>/dev/null
if [ "$1" != "" ]; then
eog $imgdir/$name
fi
$get_digits $imgdir/$name $imgdir/$name 2>/dev/null
if [ "$1" != "" ]; then
eog $imgdir/$name
fi
-$process_digits $imgdir/$name
+out=$($process_digits $imgdir/$name)
+count=0
+while [ "$out" == "?" ]; do
+ sleep 1
+ out=$($process_digits $imgdir/$name)
+ count=$(( $count + 1 ))
+ if [ "$count" == "5" ]; then
+ echo "#?"
+ exit 0
+ fi
+done
rm -f $imgdir/$name
rm -f $imgdir/$name
+echo $out
UCC
git Repository :: git.ucc.asn.au