attachInterrupt() seems to fire initially and incorrectly.

dlloyd:
You'll need to clear the interrupt flag in setup after you configure pin 2 as INPUT_PULLUP and write HIGH to the pin.

There is no need to write HIGH to the pin - that's what INPUT_PULLUP does for you - sets the pin as INPUT And then set it HIGH to activate the built in PULLUP hence the mode INPUT_PULLUP :slight_smile:

The interrupt flag is probably not set at that time unless the button was already pressed but indeed no harm in clearing it properly unless the button is down in which case you might want to capture this