Try the attached file removing the .txt
Also as languer noted, your TRIS set up is commended out. Why? According to your variables, there is a conflict with the TRIS settings. Perhaprs an input is not biased and seen as high or low irrelevant what you really do on the pin.
Ioannis
Bookmarks