#!/bin/bash

# reset the mux device to default values
python ./muxctrl.py -b -m -l 0 -s 115200

# TODO start logging of the received data
./readTTYToFile.sh /dev/ttyACM1 &

sleep 2

# read from line 0 to 7
for i in `seq 0 7`;
do
  echo "channel #"$i

  python ./muxctrl.py -l $i -m

  echo sleep 30 seconds
  sleep 30
done

sleep 3

# TODO stop logging of the received data
killall -12 readTTYToFile.sh

python ./muxctrl.py -b -m -l 0 -s 115200

