stryker wrote: Since originally reporting this I now have 4 Elevens and each one does the same. I've bought them over the intervening months since that first post, and from 3 different sources so they're not the same batch. However if you drive them specifically HIGH or LOW they do function as they are supposed to. It's only when you don't drive the D13 LED directly that it remains dimly lit.
Unusual I know, but this is actually normal behaviour on the Eleven and the other Freetronics boards.Agent wrote: Upload to the Eleven, and get a solid D13 board light. Program runs fine AFAIK.
Hit reset button, D13 board light goes out. Program runs fine AFAIK. D13 light creeps up dimly.
D13 board light goes full brightness when I physically tap on the ICSP pins. Repeat action, light goes out or dim. Not sure of cause.
When the pin 13 is driven as an output, you can expect the LED to be on when the output is HIGH and off when the output is LOW.
When pin 13 is set as an input (as is the case after reset if you don't change it), it can sometimes glow dimly or brightly depending on ambient electrical conditions. Tapping or touching parts of the board or the pin can cause it to change.
Weird, yes? It's because the Eleven and other boards have the LED driven via a FET instead of directly from the pin. In input mode, the FET's gate is "floating" and it can be capacitively charged up or down by ambient conditions including touch. When it charges up it can turn on partially (dimly on), turn on fully (fully on) or turn off.
Why is this useful? Why not just drive the LED from the pin directly like on most Arduino models? The reason is that this way you can use D13 as an input pin with any kind of input signal. If the input signal also drove an LED connected to the pin then some inputs wouldn't work, because they couldn't supply enough current to also light the LED directly. Driving the gate of the FET doesn't require any current (hence being able to drive it with your finger), therefore that pin is more flexible.
If the dim glowing is bothering you, setting pinMode(13, OUTPUT) in your Sketch and using digitalWrite(13, LOW) will stop it glowing.