The first thing that pops out at me is the ADCIN line. The ADCIN command accepts the ADC channel, not the pin. Try this instead:

ADCIN 0,an1