For auto ranging use some of the GPIO pins to switch in and
out different values.
I have used four GPIO pins and four resistors. each resistor
in series with one pin. The other ends get tied together and
then tied to one of the analog input pins. The test resistor is the connected from that point to return. By
setting one of the outputs, five volts is applied to the
resistor this forms a divider with the test resistor. I then preformed an A to D conversion and read the midpoint voltage and calculated the resistor's value. I started with the largest value resistor first and if the midpoint voltage was below 200mv (just a value I picked) I would
change the resistor by switching that output pin to an input and enable another resistor. This worked fairly well.