How to loop a program with a button

Danois90:
Instead of "pressed = true" try with "pressed = !pressed" :slight_smile:

Without state detection that probably won't yield the result the OP wants. It's going to flipping back and forth while the button is held down. Which is going to be many times in the time it takes a human to press and release a button.