button

Not sure what you want? Do you want some one to do it for you or tell you how to do it.

You need to read the button and hold in a while loop until it is pressed.
Do your thing
Then hold in a while loop until it is unpressed.