The ADC example will do it.
If you use 10 bit resolution for the ADCthe value can be 0 to 1024.