I made a sketch to switch on all digital and analog pins, and found out several pins did not work as expected. Note: I manually put a jumper wire from each digital and analog pin (one at a time) to a resistor, LED and GND pin.
What I noticed was that some pins did not work (D3, D4, A4, A6 and A7) and pin A3 was only lit about half intensity. I tried two different Nanos and they performed both equally (also pin A3 at half intensity).
I also tried the jumper wires directly touching the pins (without a breadboard in between, to rule out a breadboard problem). Same behavior (so the breadboard is ok).
My questions:
- How come pins D3, D4, A4, A6 and A7 are not output VCC (3.3V) ?
- How can I switch pins these pins on?
- What is the reason pin A3 is blinking at half intensity?
- How can I switch this pin fully on?
- Bonus question: I used numbers, why are the pin names A0..A7 and D0..D12 not defined in Arduino IDE?
Test sketch:
const int NR_OF_PINS = 22;
int pins[NR_OF_PINS] =
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
//D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 A0 A1 A2 A3 A4 A5 A6 A7
{ 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26 };
void setup()
{
for (int n = 0; n < NR_OF_PINS; n++)
{
pinMode(pins[n], OUTPUT);
digitalWrite(pins[n], HIGH);
}
}
void loop()
{
}