worked fine before the device glitched out,
Have you got a series resistor in that LED?
but what I want to know is how to actually get 1024 out of the led. not 255.
I recognise the words but I can attach no meaning to them.
You do not get anything out of an LED 1024 or 255!
You feed an LED with a voltage that lights it up, and the resistor keeps the current in check.
The analogue output is just PWM it is not an output of changing voltage.
See:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html