mirror of
https://github.com/eddyem/stm32samples.git
synced 2025-12-06 02:35:23 +03:00
forgot to add testDev in last commit
This commit is contained in:
parent
6adf025f62
commit
8bb8f93f83
22
F1:F103/BISS_C_encoders/testDev
Executable file
22
F1:F103/BISS_C_encoders/testDev
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
trap ctrl_c INT
|
||||
|
||||
function ctrl_c() {
|
||||
echo "Terminated - exit" >&2
|
||||
exit 0
|
||||
}
|
||||
|
||||
if [[ $# != 1 ]]; then
|
||||
echo "Point device name, e.g. /dev/encoder_X0" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
stty -F $1 -echo
|
||||
|
||||
START=$(date +%s)
|
||||
|
||||
while read VAL; do
|
||||
CUR=$(($(date +%s) - $START))
|
||||
echo -e "$CUR.$(date +%N)\t$VAL"
|
||||
done < $1
|
||||
Loading…
x
Reference in New Issue
Block a user