Raspberry Pi SPI and I2C Tutorial
The Pi Wedge helps access the I2C and SPI signals.
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.
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.