The main part left out of you program is failure to actually READ the pin in to the constant you are checking.
Paul