I am programming an Arduino Uno. The board is connected to my PC via USB cable. I run the following code with pin 8 wired to an external LED. The program boots and the LED turns on.
If I open the serial monitor in the Arduino IDE, the LED turns off for ~2 seconds and then turns on again.
Why would opening the serial monitor affect the state of the pins on the Arduino? Is the chip faulty or am I missing something obvious?