If the sketch works for as long as you don’t open the serial monitor, but stops the moment you open it, hen you have misconfigured DTR/RTS lines and that causes the chip to held in reset.
Please try all available combinations from here.
If the sketch works for as long as you don’t open the serial monitor, but stops the moment you open it, hen you have misconfigured DTR/RTS lines and that causes the chip to held in reset.
Please try all available combinations from here.