Not the answer but ...For this sort of task I would use an external pull up resistor of say 1kohm - the internal pull up is a high value and you can get problems with long lead length to your switch .
Try running the digital input example and get that working