This example shows a very basic use of the NXT flag function. A flag is created and set to true only when the touch sensor is pressed. The flag is then used as a stop condition for a while loop.