Reference · Quick lookup

Signals & Buses

The ways a microcontroller pin talks — and how modules connect. Print me.

Distilled from Lesson 14 (signals) and Lesson 15 (buses). Voltage still matters everywhere: 3.3V (ESP32) vs 5V (Uno).

Pin signal types

TypeDirectionCodeUse for
DigitalIn / OutdigitalRead / digitalWriteOn/off: LED, relay, button, PIR
Analog in (ADC)InanalogRead (Uno 0–1023, ESP32 0–4095)Levels: pot, photoresistor, thermistor
PWM ("fake analog")OutanalogWrite (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.

Communication buses

BusWiresDevicesBest for
UART (Serial)TX, RX2 (point-to-point)Board↔PC (Serial Monitor), GPS, a few modules
I²CSDA, SCL (shared) + pull-upsMany (addressed)The hobby default — most sensors & small displays
SPIMOSI, MISO, SCK, CS/deviceMany (one CS each)Fast: displays, SD cards, high-rate sensors
Wiring I²C (you'll do this most) 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.
Choosing a bus Default to I²C (fewest wires, many devices). Use SPI for speed (displays/SD). UART for the computer link and a handful of serial modules.

← Course home · Glossary · Rules of thumb