#!/bin/bash
arguments=( sensor-gain-one sensor-gain-two
set-carrier-null carrier-null ad-ref-hi ad-ref-lo
detect-finger measure-freq measure-drive detect-freq
detect-drive column-scan-rate detect-capacitor detect-resistor
z-matrix demodulation-phase chip-type 
drive-boost normalize-phase disable-image-data row-histogram
 detect-debound-delay z-matrix-vpatt
z-matrix-hpatt demod-phase-one demod-phase-two 
data-format binary-threshhold test-registers full-histogram enable-histogram
z-matrix-doubler square-wave force-finger-detect sync-serial-int channel-bias
image-data-bit-4 reg-A1 reg-A7 reg-A9 reg-B4 reg-BB reg-83)
maxvalue=(3 3 15 1 127 127 1 7 3 7 3 7 127 7 1 127 127 1 1 1 1 3
3 3 127 127 15 15 1 1 1 1 1 1 1 127 1 127 127 127 127 127 15)
x=0
while [ $x -lt 49 ]
do
	counter=${maxvalue[x]}
	while [ $counter -gt 0 ]; 
	do
		./setdefaults.sh
		./biocntl -d /dev/biopod0 --${arguments[x]} $counter -s 1
		./convert.sh "image_"${arguments[x]}"_"$counter
		let counter=counter-1
	done
	let x=x+1
done	
	

