rcrf-wifi/plot.sh

25 lines
592 B
Bash
Executable File

#!/bin/bash
function sample() {
sigrok-cli -d fx2lafw:conn=1.13 --config 'samplerate=1 MHz' -C D5,D7 --time 400ms -P servo:data=D5 -P servo:data=D7
}
samples=$(sample | head -n2 | sed -e 's/servo-[12]: //')
cha=$(echo "$samples" | head -n1)
cha_c=$(( ( `echo $cha | tr -d '.'` - 1000 ) / 10 ))
chb=$(echo "$samples" | tail -n1)
chb_c=$(( ( `echo $chb | tr -d '.'` - 1000 ) / 10 ))
echo -n " |"
printf "%0.s " $(seq 1 49)
echo -n "|"
printf "%0.s " $(seq 1 49)
echo "|"
echo -n "A: $cha "
printf "%0.s#" $(seq 1 $cha_c)
echo
echo -n "B: $chb "
printf "%0.s#" $(seq 1 $chb_c)
echo