To divide the battery voltage down you need two resistors. Resistor 1 needs to be twice the value of resistor two - say 20k and 10k. You connect the 20k to 12V the 10k to Gnd and join the free ends. Where they join goes to an analogue in pin. You could of course substitute the 20k resistor with two 10k resistors in series.
Mike.
Mike.