So, I am trying to setup a small bench setup to develop my code and I was using the example code for Digital -> Button as an initial boilerplate.
However things are not really working as I would expect and I am not sure what is going on.
It seems that either the Led, the button, or both, seem to affect the behaviour of the microcontroller ?! E.g. freezing it ?
e.g., uploading the Digital->Button example code to the board, the LED starts HIGH even if the button isn't pressed and it goes to LOW when the button is pressed but it seems it only happens because the board freezes when the button is pressed.
Why I think the board freezes is because when I add a serial interface to check the button/led state in the Serial Monitor window, then the serial interface also freezes.
I was thinking that perhaps the Led Pin would interfere with the serial interface somehow, so I tried to connect another pin (3) to a PWM relay but that is also having a strange behaviour where the relay is only triggered if I quickly press and release the button ....
Can someone perhaps shed some light ?