What is the situation when the pin mode is not specified?


I got an Arduino for my birthday earlier this week and so I am very new to using it.

I was doing one of the projects and forgot to use the pinMode command to set the pins for output. They were powering LEDs. When I ran the sketch the LEDs glowed very dimly. After making a number of changes to see if I selected the wrong resistor I eventually realised my mistake.

Can anyone explain what was happening as a result of not specifying the pins?


Arduino pins default to INPUT if no pinMode() is specified

And writing to an input port controls the internal PULL-UP which is in the 20k+ region.

So that resistor is in line and limits the current.

Thanks. That explains why the LED was so dim.

@iscaboy, your topic has been moved to a more suitable location on the forum.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.