Do you have an external resistor wired with your switch? You are not using the internal pullup resistor, so you MUST have an external one. Is it wired as a pullup or pulldown resistor?
Do you have an external resistor wired with your switch? You are not using the internal pullup resistor, so you MUST have an external one. Is it wired as a pullup or pulldown resistor?