Content originally posted in LPCWare by Rob65 on Mon Jun 11 21:16:16 MST 2012
Let's see if you can answer this yourself.
Would reading the pin involve writing or reading from the FIOPIN register ?
and why would you keep setting the pin as an input pin in the while loop ?
Check the LPC1769 user manual, there is a GPIO section describing the registers.