button to run loop once then await button press

if(there was a change from low to high) //see change in state example for coding
{
flag = true;
}

if(flag == true)
{
//do stuff

flag = false;
}

//more code