Why does the LED turn on after the while loop becomes false?

The button is just wired via GND and pin 3. To workaround using an external resistor I just implemented pinMode(3, INPUT_PULLUP);

  • UNO r3 (Third party - ELEGOO)
1 Like