Reference · Quick lookup
The ways a microcontroller pin talks — and how modules connect. Print me.
| Type | Direction | Code | Use for |
|---|---|---|---|
| Digital | In / Out | digitalRead / digitalWrite | On/off: LED, relay, button, PIR |
| Analog in (ADC) | In | analogRead (Uno 0–1023, ESP32 0–4095) | Levels: pot, photoresistor, thermistor |
| PWM ("fake analog") | Out | analogWrite (0–255 duty) | Dimming, motor speed, servo signal |
PWM = rapid on/off; the on-fraction (duty cycle) sets the average. Not a true steady voltage.
| Bus | Wires | Devices | Best for |
|---|---|---|---|
| UART (Serial) | TX, RX | 2 (point-to-point) | Board↔PC (Serial Monitor), GPS, a few modules |
| I²C | SDA, SCL (shared) + pull-ups | Many (addressed) | The hobby default — most sensors & small displays |
| SPI | MOSI, MISO, SCK, CS/device | Many (one CS each) | Fast: displays, SD cards, high-rate sensors |
SDA→SDA, SCL→SCL, power, ground; pull-ups on SDA/SCL (usually already on the
breakout). Then install the module's library and call its functions.