OK, I have submitted a pull request to specify this:
Please review my proposed changes and either request changes or submit an approval.
I did a comprehensive review of all the examples and found the same occurred on 10 others, which my proposal fixes in addition to the "AnalogInput" example mentioned here.
As noted on many Arduino boards there is already an LED on digital output 13,
Well not many, the resistor on pin 13 disappeared in about 2006 but the tutorials still hang around.
It was removed because it interfered with using pin 13 on SPI circuits.
Grumpy_Mike:
Well not many, the resistor on pin 13 disappeared in about 2006 but the tutorials still hang around.
It was removed because it interfered with using pin 13 on SPI circuits.
As you might remember I first came here 2 or 3 years ago so am not really familiar with the history of Arduino. I have a genuine Uno and a clone Mega; both of recent vintage and with LEDs on pin 13. My more recent purchase of a Nano Every also has the LED on pin 13. Can you clarify what you mean?
Uno and Mega have D13 going to an op amp/comparator (1/2 of LM358) which then drives the LED, so the load on D13 is only 1-2uA, vs 5-10-15 mA to drive the LED.
Nano still drives the LED thru a current limit resistor.
Long ago, there was a major foul-up in the design of the Arduino NG, the predecessor to the Diecimila which preceded the Duemilanove from which the UNO was derived!
As you will note, pin 13 was connected to a resistor and LED, but instead of also connecting the pin to the header, the header instead connected to the LED and that via a second 470 Ohm resistor, not only rendering pin 13 essentially functionally inaccessible to the outside world but even then, while this meant that an external LED could safely be connected without a resistor to this header pin, its brightness was minimised
Quite a peculiar blunder - I do wonder how it occurred (in two successive issues!), back in the mists of Arduino time.
PerryBebbington:
Ever looked back at something you designed a long time ago and wondered "why the ... did I do that???"
Many years ago when I was designing my first product with a business partner, we would often say “why is this bit like it is”, if the answer was “historic” it meant that at one stage it was important to do that but the reason for doing it exactly that way has gone away and now it is as good as any other way.
Arduino's policy is that every pull request must receive a formal approval via the GitHub pull request review system before it can be merged. This makes sure there have been at least two sets of eyes on every change: the person who submitted the proposal and the person who approved it. So once I get an approval from someone I will be able to merge the pull request and the world will be an ever so slightly better place.