Resetting code with a button. Going to the top with a push of a button.

Below is my coding, I want to repeat the blinking and be able to go from line 127 to the very top, so the light will continue to blink after losing WiFi connection until you push a button which resets the coding to go back to the very top and reconnect to the wifi if it is available.

WiFiWebClientRepeating.ino (3.82 KB)

and be able to go from line 127 to the very top

Of Mt. Rainier? The very top of what?

If you properly indented your code, you'd see that after line 127 (a blank line) come the end of the else block, followed by the end of loop(), so after 127, you go to the very top of loop().

But, because the blinking happens ONE time when you fail to connect, the blinking will not continue when you get back to the top of loop().

If you want that to happen, you'll look at the blink without delay example, without delay, and completely restructure your code.

Blinking needs to happen, or it doesn't. If it does, it is time to toggle the state of the LED, or it isn't. Some really simple if statements, and Bob's your uncle.

If you didn't use delay() then you would not need to consider loony ideas such as

to go from line 127 to the very top,

See Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.