Raspberry Pi SPI and I2C Tutorial

Connecting To The Ports
Screen Shot 2020-02-27 at 9.29.03 PM.png
Screen Shot 2020-02-27 at 9.30.44 PM.png

This tutorial will walk you through getting the I2C and SPI interfaces of your Raspberry Pi working. These interfaces aren’t enabled by default, and need some extra configuration before you can use them.

Recommended Reading

Before we get started, you might want to review some related background material.

  • I2C is a useful bus that allows data exchange between microcontrollers and peripherals with a minimum of wiring.
  • SPI is a cousin of I2C with similar applications.
  • For the C/C++ examples, we’ll be using the wiringPi library to interface with these buses
  • For the Python examples, we’ll be using spidev for SPI and smbus for I2C.