problem with my if statment

It's possible the pin burnt out on the chip. Try using a different pin and see if the results change