Before you can send data over Wi-Fi or Bluetooth, you need the basics: printing text so you (the human) can see what your program is doing, and wiring protocols so your board can talk to other chips sitting right next to it on the same breadboard. This topic covers four of those basics: the serial console (your program's "voice"), UART (a simple 2-wire link between two devices), I2C (a shared 2-wire bus for many devices at once), and SPI (a faster 4-wire bus for one device at a time).
1. Real-World Uses
- Console printing is the single most-used debugging tool in electronics — printing a sensor value or a status message to see what your code is actually doing, especially when something isn't working as expected.
- UART connects two devices directly with just 2 wires (TX/RX) — used for GPS modules, Bluetooth-to-serial adapters (like the HC-05), and linking two microcontroller boards together.
- I2C is the bus behind most of the sensors and displays already covered in this wiki (the OLED in 10.6, the LCD I2C backpack in 10.3, and more) — its superpower is that dozens of different devices can share the same 2 wires (SDA/SCL), each picked out by its own address.
- SPI is the fastest of the wired protocols here, used when speed matters — TFT displays (10.5), SD cards (Chapter 8), and the MAX7219 LED matrix (10.4) all use it.
- I2C Scan specifically is a classic troubleshooting tool — plug in a mystery sensor module and run a scan to find out exactly which address it's actually using, without digging through a datasheet.
