CNAP

Arduino Uno Reference

The ATmega328P-based development board. It is the default board in every CNAP template and the starting point for most beginner Arduino projects.

Pin names

Digital pins (top header)

Pin IDLabelSignalNotes
0D0 / RXUSARTSerial receive — avoid for GPIO when using Serial
1D1 / TXUSARTSerial transmit — avoid for GPIO when using Serial
2D2DigitalExternal interrupt INT0
3D3PWMExternal interrupt INT1, analogWrite()
4D4Digital
5D5PWManalogWrite()
6D6PWManalogWrite()
7D7Digital
8D8Digital
9D9PWManalogWrite()
10D10 / SSSPISPI slave select, analogWrite()
11D11 / MOSIPWM / SPISPI data out, analogWrite()
12D12 / MISOSPISPI data in
13D13 / SCKSPISPI clock, built-in LED
GND.1GNDPowerGround (top header)
AREFAREFAnalog reference voltage
A4.2A4 / SCLI²CI²C clock (shared with analog A4)
A5.2A5 / SDAI²CI²C data (shared with analog A5)

Power & analog pins (bottom header)

Pin IDLabelSignalNotes
IOREFIOREFBoard operating voltage reference
RESETRESETPull LOW to reset the board
3.3V3.3VPower3.3 V output, max 50 mA
5V5VPower5 V output
GND.2GNDPowerGround
GND.3GNDPowerGround
VINVINPowerExternal power input (7–12 V)
A0A0AnaloganalogRead(), 10-bit (0–1023)
A1A1AnaloganalogRead()
A2A2AnaloganalogRead()
A3A3AnaloganalogRead()
A4A4AnaloganalogRead(), I²C SDA
A5A5AnaloganalogRead(), I²C SCL

Quick reference

CapabilityPins
Digital I/OD0–D13 (14 pins)
Analog inputA0–A5 (6 pins, 10-bit)
PWM outputD3, D5, D6, D9, D10, D11
SPID10 (SS), D11 (MOSI), D12 (MISO), D13 (SCK)
I²CA4 (SDA), A5 (SCL)
USARTD0 (RX), D1 (TX)
Operating voltage5 V
Clock speed16 MHz

Usage

void setup() {
  pinMode(13, OUTPUT);   // configure pin as output
  Serial.begin(9600);    // start serial at 9600 baud (uses D0/D1)
}

void loop() {
  digitalWrite(13, HIGH);       // digital output
  int val = analogRead(A0);     // analog input (0–1023)
  analogWrite(9, 128);          // PWM output (0–255)
  Serial.println(val);
  delay(500);
}

Built-in LED

Pin 13 is connected to a small LED on the board itself. It is the fastest way to test that your sketch is running — no external components needed.

void setup() { pinMode(LED_BUILTIN, OUTPUT); }
void loop() {
  digitalWrite(LED_BUILTIN, HIGH); delay(500);
  digitalWrite(LED_BUILTIN, LOW);  delay(500);
}

Serial monitor tip

D0 (RX) and D1 (TX) are shared with the USB-serial chip. When you call Serial.begin(), avoid using these pins for other GPIO — doing so will corrupt serial output and can block uploading in real hardware.

See also

  • LED — connect to any digital pin via a resistor
  • Resistor — always use in series with an LED
  • Pushbutton — connect to a digital input pin
  • Arduino Mega — same core with far more I/O
  • Arduino Nano — same core in a breadboard-friendly form factor
  • ESP32 DevKit V1 — WiFi/Bluetooth-capable alternative, 3.3V logic