Hi @xvs03. Thanks for giving the beta stage Arduino IDE 2.x a try!
The reason for the results your observing is that, unlike the classic Arduino IDE, Arduino IDE 2.x's Serial Monitor currently has a very poor throughput. It simply can't keep up with this sort of sketch that blasts it with data as fast as the microcontroller can pump it out. So what is happening is you are seeing older and older data in the Serial Monitor as it gets farther and farther behind on outputting the backlog. If you wait long enough, you will see the changed pin state come through, but of course we expect it to be immediate.
The deficiency is being tracked here:
If you add some code to your sketch to limit the serial prints to a reasonable rate, you'll find it works as expected. The easiest way to do that is to just add a delay(), but of course that can often cause problems. You could also modify your sketch to only print when the pin state has changed.
Thank you for the explanation.
Yes the time difference I have also noticed. Thanks for your tips. I hope in the final version the problem will be overcome. I personally like the version 2.0 already very much.