1
0
Fork 0
Scripts/Perso/serialToCSV.sh

21 lines
No EOL
546 B
Bash
Executable file

#! /bin/bash
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
boucle=true
stty -F /dev/ttyACM0 115200 raw -echo -echoe -echok
if [ $# -eq 3 ]; then
fileName="./serialOutput/serialOutput-"$1","$2","$3".csv"
else
fileName="./serialOutput/serialOutput.csv"
fi
rm -f $fileName
touch $fileName
while $boucle; do
read line < /dev/ttyACM0
echo $line >> $fileName
done