Displaying temperature data using the SPI
In this section, we will make use of an OLED display that comes with an SSD1306 driver. The Serial Peripheral Interface (SPI) will display the temperature and humidity data we retrieved in the previous section. Before we get started, let's take a quick look at the SPI bus.
The Serial Peripheral Interface (SPI)
The SPI is commonly used to interface peripherals such as microSD cards, memory devices, sensors, and so on. It is a synchronous interface like the I2C interface where we use a clock signal to keep the host and the peripheral in sync. The SPI bus typically consists of the following pins:
- Chip Select (CS) – Enables the host to select the peripheral device with which it wants to initiate communication. The chip select pin enables multiple devices on the same bus.
- Data Out (DO) – The pin used by the host device to transmit data to the peripheral.
- Data In (DI) – The pin used by the host device...