#!/bin/sh -x

cmd=`basename "$0"`

usage="Usage: $cmd [-d device]"

badopts=
while :
do  case $1 in
	-d)	device=$2; shift ;;
	--)	shift; break ;;
	-?*)	echo "$cmd: unrecognised option: $1"; badopts=1 ;;
	*)	break ;;
    esac
    shift
done

[ $badopts ] && { echo "$usage" >&2; exit 2; }

while true
do
  /usr/src/i2c/test_i2c -d $device -t 200 -c 100 -r 10 &
#  /usr/src/i2c/test_i2c -d 0x30 -d light -t 200 -c 100 -r 10 &
  sleep 1;
  killall test_i2c
done

