user31105: 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() 
{
}


user4143: You don't need an array, and your "base" pin is wrong - you start at pin 1, not pin 0. Also pins A6 and A7 can only be analog inputs, not digital outputs.
It's simpler to write:
void setup() {
    for (uint8_t i = 0; i < NUM_DIGITAL_PINS; i++) {
        pinMode(i, OUTPUT);
        digitalWrite(i, HIGH);
    }
}

void loop() {
}

That will work correctly on all Arduino boards regardless of the number of pins, since the board definition defines how many pins there are, and pins are always contiguously numbered from 0.

31105: <p>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.</p>

<p>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).</p>

<p>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).</p>

<p>My questions:</p>

<ol>
<li>How come pins D3, D4, A4, A6 and A7 are not output VCC (3.3V) ?</li>
<li>How can I switch pins these pins on?</li>
<li>What is the reason pin A3 is blinking at half intensity?</li>
<li>How can I switch this pin fully on?</li>
<li>Bonus question: I used numbers, why are the pin names A0..A7 and D0..D12 not defined in Arduino IDE?</li>
</ol>

<hr>

<p>Test sketch:</p>

<pre><code>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 &lt; NR_OF_PINS; n++)
  { 
    pinMode(pins[n], OUTPUT);
    digitalWrite(pins[n], HIGH);
  }
}

void loop() 
{
}
</code></pre>
 4143: <p>You don't need an array, and your "base" pin is wrong - you start at pin 1, not pin 0. Also pins A6 and A7 can only be analog inputs, not digital outputs.</p>

<p>It's simpler to write:</p>

<pre><code>void setup() {
    for (uint8_t i = 0; i &lt; NUM_DIGITAL_PINS; i++) {
        pinMode(i, OUTPUT);
        digitalWrite(i, HIGH);
    }
}

void loop() {
}
</code></pre>

<p>That will work correctly on all Arduino boards regardless of the number of pins, since the board definition defines how many pins there are, and pins are always contiguously numbered from 0.</p>
