Was the battery voltage divider in circuit before the ADC command was added and the first measurments taken?

Leave the code as is and disconnect the divider from the battery and see if that makes a difference.