







| Board | MCU | MHz | Flash | SRAM | I/O V | Digital | Analog | WiFi | BLE | USB |
|---|---|---|---|---|---|---|---|---|---|---|
| Uno R3 | ATmega328P | 16 | 32KB | 2KB | 5V | 14 | 6 | — | — | Bridge |
| Uno R4 WiFi | Renesas RA4M1 | 48 | 256KB | 32KB | 5V | 14 | 6 | ✓ | ✓ | Native |
| Mega 2560 | ATmega2560 | 16 | 256KB | 8KB | 5V | 54 | 16 | — | — | Bridge |
| Nano | ATmega328P | 16 | 32KB | 2KB | 5V | 22 | 8 | — | — | Bridge |
| Nano Every | ATmega4809 | 20 | 48KB | 6KB | 5V | 24 | 8 | — | — | Bridge |
| Nano 33 IoT | SAMD21 M0+ | 48 | 256KB | 32KB | 3.3V | 22 | 8 | ✓ | ✓ | Native |
| Nano ESP32 | ESP32-S3 | 240 | 16MB | 512KB | 3.3V | 22 | 8 | ✓ | ✓ | Native |
| Leonardo | ATmega32U4 | 16 | 32KB | 2.5KB | 5V | 20 | 12 | — | — | Native HID |
| Due | SAM3X8E M3 | 84 | 512KB | 96KB | 3.3V | 54 | 12 | — | — | 2× Native |
| MKR WiFi 1010 | SAMD21 M0+ | 48 | 256KB | 32KB | 3.3V | 22 | 7 | ✓ | ✓ | Native |
| Pin | Features | Notes |
|---|---|---|
| D0 | RX | Serial receive |
| D1 | TX | Serial transmit |
| D2 | INT0 | External interrupt |
| D3 | PWMINT1 | Timer2 |
| D4 | GPIO | |
| D5 | PWM | Timer0 |
| D6 | PWM | Timer0 |
| D7 | GPIO | |
| D8 | GPIO | |
| D9 | PWM | Timer1 |
| D10 | PWMSS | SPI, Timer1 |
| D11 | PWMMOSI | SPI, Timer2 |
| D12 | MISO | SPI |
| D13 | SCK | SPI, built-in LED |
| Pin | Features | 10-bit Range |
|---|---|---|
| A0 | ADC0 | 0–1023 |
| A1 | ADC1 | 0–1023 |
| A2 | ADC2 | 0–1023 |
| A3 | ADC3 | 0–1023 |
| A4 | SDA | I²C data |
| A5 | SCL | I²C clock |
| Pin | Voltage | Notes |
|---|---|---|
| VIN | 7–12V | Barrel jack input |
| 5V | 5V regulated | 200mA max from USB |
| 3.3V | 3.3V | 50mA max |
| GND | 0V | 3 pins total |
| RESET | Active low | Pull low to reset |
| IOREF | 5V or 3.3V | Shield voltage ref |
| Timer | Bits | Pins | Default Freq | Use |
|---|---|---|---|---|
| Timer0 | 8-bit | D5, D6 | 976 Hz | millis(), delay(), PWM |
| Timer1 | 16-bit | D9, D10 | 488 Hz | Servo, precise timing, PWM |
| Timer2 | 8-bit | D3, D11 | 976 Hz | Tone(), async PWM |
| Prescaler | Timer0/2 (8-bit) | Timer1 (16-bit) |
|---|---|---|
| 1 (CS=001) | 62.5 kHz | 62.5 kHz |
| 8 (CS=010) | 7.8 kHz | 7.8 kHz |
| 64 (CS=011) | 976 Hz (default) | 976 Hz (default) |
| 256 (CS=100) | 244 Hz | 244 Hz |
| 1024 (CS=101) | 61 Hz | 61 Hz |
analogWrite(pin, val) — val 0–255 maps to 0%–100% duty cycle at ~490 Hz (D3,D9,D10,D11) or ~980 Hz (D5,D6).const int LED = 13; unsigned long prev = 0; const long interval = 500; void setup() { pinMode(LED, OUTPUT); } void loop() { unsigned long now = millis(); if (now - prev >= interval) { prev = now; digitalWrite(LED, !digitalRead(LED)); } }
void setup() { Serial.begin(9600); } void loop() { int val = analogRead(A0); // 0–1023 float volts = val * (5.0 / 1023.0); // convert to volts Serial.print("A0: "); Serial.print(volts); Serial.println(" V"); delay(500); }
#include <Wire.h> void setup() { Serial.begin(9600); Wire.begin(); Serial.println("Scanning I2C bus..."); for(byte a=1; a<127; a++){ Wire.beginTransmission(a); if(Wire.endTransmission()==0){ Serial.print("Found: 0x"); Serial.println(a, HEX); } } }
const int BTN=2; bool state, last; unsigned long debounce=50, t=0; void setup(){ pinMode(BTN, INPUT_PULLUP); } void loop(){ bool reading = !digitalRead(BTN); // active low if(reading != last) t = millis(); if(millis()-t > debounce) state = reading; last = reading; }
pinMode(pin, mode) | INPUT, OUTPUT, INPUT_PULLUP |
digitalWrite(pin, val) | HIGH or LOW |
digitalRead(pin) | Returns HIGH or LOW |
analogRead(pin) | 0–1023 (10-bit, 5V ref) |
analogWrite(pin, val) | 0–255 PWM duty cycle |
analogReference(type) | DEFAULT/INTERNAL/EXTERNAL |
millis() | ms since boot (rolls ~49 days) |
micros() | µs since boot (rolls ~70 min) |
delay(ms) | Blocking delay |
delayMicroseconds(us) | Blocking µs delay |
map(x, iL, iH, oL, oH) | Remap value range |
constrain(x, lo, hi) | Clamp to range |
abs(x) | Absolute value |
sqrt(x) | Square root (float) |
| MCU | ATmega328P @ 16 MHz |
| Flash | 32 KB (0.5 KB bootloader) |
| SRAM | 2 KB |
| EEPROM | 1 KB |
| Digital I/O | 14 pins (6 PWM) |
| Analog In | 6 pins (10-bit ADC) |
| I/O Voltage | 5V (NOT 3.3V tolerant!) |
| Max I/O current | 40mA per pin, 200mA total |
| USB | Atmega16U2 USB-Serial bridge |