This question already has an answer here:
I am using an Arduino UNO.
On any digital/analog pin, if an LED (with resistor) is connected and we use digitalWrite(pin,HIGH) the LED lights up rather dimly.
On the other hand, if we use pinMode(pin,OUTPUT) and then use digitalWrite, the LED lights up to maximum intensity.
I checked that in both cases, the voltage on the pin is 5V. Any explanation for this ? Thanks.