Uno Reference Voltage of 1.1v

gggggggg:
I have 4 x AA batteries connected to the barrel connector.

With Vcc regulated to 5V, why aren't you: using Vcc as the reference, a voltage divider to get the battery voltage in range (I'd just cut it in half), and measuring that in the plain-ol-analogRead fashion?

The code you are trying to use was meant for a processor running directly from batteries. I don't think it functions correctly the way you are trying to use it (AREF > Vcc).