Program using a button timer

this was helpful, ty! I am trying to work out how to use functions which is why it is structured this way so I appreciate you not trying to rework the whole thing.