2017-12-12 23:04:56 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
2018-01-11 01:59:16 +01:00
|
|
|
trap "boucle=false ; python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 ; exit" INT
|
|
|
|
trap "boucle=false ; python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 ; exit" TERM
|
2017-12-13 17:05:03 +01:00
|
|
|
boucle=true
|
|
|
|
|
2017-12-12 23:04:56 +01:00
|
|
|
stty -F /dev/ttyACM0 115200 raw -echo -echoe -echok
|
|
|
|
|
2017-12-13 17:33:02 +01:00
|
|
|
if [ $# -eq 3 ]; then
|
|
|
|
fileName="./serialOutput/serialOutput-"$1","$2","$3".csv"
|
|
|
|
else
|
|
|
|
fileName="./serialOutput/serialOutput.csv"
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f $fileName
|
|
|
|
touch $fileName
|
2017-12-12 23:04:56 +01:00
|
|
|
|
2017-12-13 17:05:03 +01:00
|
|
|
while $boucle; do
|
2017-12-12 23:04:56 +01:00
|
|
|
read line < /dev/ttyACM0
|
2017-12-13 17:33:02 +01:00
|
|
|
echo $line >> $fileName
|
2018-01-11 01:59:16 +01:00
|
|
|
done
|