Arduino Micro Pin # to Software Label

I found one forum post from 2014 and closed 2020 that didn't actually answer the question of what name in software goes with which pin on Arduino Micro.

There are 24 digital I/O, or 12 digital I/O and 12 analog inputs. The analog are overlapped with digital so you can have combinations like (digital/analog) 12/12, 15/9, 23/1, etc.

Digital I/O pins are referenced in software using an integer number, 0-23, ex., pinMode(14, OUTPUT | INPUT | INPUT_PULLUP);, digitalWrite(14, HIGH);, digitalWrite(14, LOW);, state = digitalRead(14);, where '14' selects the MISO J6-2 pin. You can also use more informative names like pinMode(MISO, OUTPUT);

Analog input names are A0-A11 and used as int = analogRead(A3);. (analogWrite(n, val) uses integer number of the PWM pins).

I only included the integer and analog names in the pdf. I also included the ATmega32U4 pin number and port designation. The J5 and J6 designations are from the Adafruit co-design schematic.

ArduinoMicroPinList.pdf (217.8 KB)

DO NOT use pinMode() on pins used only for analogRead(). Use pinMode() ONLY on pins used for digitalRead() and digitalWrite(). For example, setting pinMode(A7, INPUT) on an Arduino Nano will set Pin 9 by accident.

Thank you John. I didn't know that. A quick check showed both analogRead and analogWrite do not use pinMode. I've corrected the post to reflect your correction.