18 *) echo "Bad pin number $pin, must be 0..3" ; exit 1 ;;
21 i2cset -y 0 0x48 1 $CFG w
22 RES=`i2cget -y 0 0x48 1 w`
23 until [ "$RES" = "$CFG" ] ; do
24 RES=`i2cget -y 0 0x48 1 w`
26 X=`i2cget -y 0 0x48 0 w`
28 XX="0x0`echo $X | cut -c 5-6``echo $X | cut -c 3`"
29 VIND=$(( ( $XX + 32768 / 40960 ) * 20480 / 32768 ))
31 VINF=$(( $VIND - $VIN * 10 ))
33 printf "VIN$pin (mv) %d.%01d\n" $VIN $VINF