#!/bin/sh # This script checks the order of values read from HAL sensors when motor # rotates two turns in one directrion and two turns in the oposite direction. D=/dev/ttyUSB0 stty -F $D -crtscts -ixon -ixoff 19200 echo > $D sleep 0.1 echo > $D sleep 0.1 echo -n 'hal' > $D sleep 0.1 echo -n 'test' > $D sleep 0.1 echo ' 1' > $D awk '{ if ($2 != last) { printf("* %05d 0x%02x (%s)\n",$1,$2,$0); last=$2; }}' < $D