you should state what kind of Uc u using.

anywhere if you want to use PORTA which is analog mode.Normally alot people for get to change it to digital mode. you need to add this command in your code

CMCON=7 'change the pin to digital
ADCON1 = 7 ' for PIC16C7xx, 16F87x, 12C67Fx
ANSEL = 0 ' register for 12F675 and 16F676

people tend to forget to set all this before using the analog pin.