AnalogRead always 1023 on Arduino Due?
You need to add this to your setup():

pinMode(A0, INPUT);


...to set the pin for reading.

Since you're reading an input that's already pulled up (in the middle of a voltage divider), that should be all. However, you can turn on the internal pull-up with:

digitalWrite(A0, HIGH);


...while the pin is in input mode.

More details here:

http://arduino.cc/en/Reference/PinMode

http://arduino.cc/en/Tutorial/AnalogInputPins