Take a look at this example
http://www.rentron.com/PICX2.htm
Or use the ADCIN command built into PBP, looks like you are mixing both ways.