O'Reilly logo

Raspberry Pi Cookbook for Python Programmers by Tim Cox

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using SPI to control an LED matrix

In Chapter 7, Sense and Display Real-world Data, we connected to devices using a bus protocol called I2C. The Raspberry Pi also supports another chip-to-chip protocol called SPI (Serial Peripheral Interface). The SPI bus differs from I2C because it uses two single direction data lines (where I2C uses one bidirectional data line). Although SPI requires more wires (I2C uses two bus signals, SDA and SCL), it supports the simultaneous sending and receiving of data and much higher clock speeds than I2C.

Using SPI to control an LED matrix

General connections of SPI devices with the Raspberry Pi

The SPI bus consists of the following four signals:

  • SCLK: This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required