http://www.picbasic.co.uk/forum/showthread.php?t=561
Not sure of the PIC you are using...but if it has analog on it the above should help.