Starting and stopping a loop via a button

Use pinMode() instead of setMode()