For some reason, when I connect my Arduino Uno to my computer, the built-in LED ("L" at pin 13) comes on, even if there's no sketch loaded. I had to write a sketch that shuts it off. This started happening a while ago. Any ideas why this happens and how to fix it? Thanks!
It's normal on original Unos; mine do it as well. The reason is that there is a high-impedance circuit that picks up noise from the environment which the comparator (that drives the LED) sees as a HIGH. When you set the pin to output, the output basically is a short and no noise can be picked up.
Clones that don't use the comparator don't have the problem because the high impedance of the pin can't deliver enough current to drive the led (I have a Sparkfun Redboard that does not show the behaviour because it directly drives the LED.