[HELP] online monitoring of a switch

Post you program here so that we can see what you are doing. Use code tags (</> top left icon in the forum editor)

The symptoms you describe sound like you are using delay() for timing and if so you will need to change to using millis() for timing.

See Using millis() for timing. A beginners guide and Several things at the same time if you are not familiar with how to use millis()