Serial monitor sometimes works, sometimes not

Hi all,
I wrote a small test program to check and change states of some digital pins. The program starts with putting out a couple of texts with Serial.print.
Now sometimes I see these texts in the monitor, and (more often) I see nothing.
I suspected it could be because when I start the monitor, the program has already finished. But I see no output even I reset the Nano.
With the old IDE (in 2021) and the same Nano I never had this problem.
Regards,
Hans

which nano do you really have ? (this is the classic Nano category, so based on the ATmega328)

1 Like

In your setup() just after serial begin add a delay(3000), this will give things time to settle down. It is also a good practice if you happen to flood the serial port.

Thanks for the answers, gents.
It is a Namo clone, but with a real Atmega 328, although I need a strong loupe to read the inscription.
Adding a delay is a good idea, thanks gilshultz.
I think now that part of the problem is that although the program compiles, it does not do what I wanted it to do... :blush:
I want to use D6 to D10 acting as a kind of switch, to start 5 different test tasks. The switch should happen by touching one of the Dx with a grounded wire. It seems I struggle a bit with the correct setup for the Dx 's (PULLUP or no?).
Firstly I want to print if they are HIGH or LOW.
Several readings of the digital pin description did not help much.
Regards,
Hans

Post your code and a picture of your circuit

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.