Recall & Review
beginner
What does SPI stand for and what is its main purpose?
SPI stands for Serial Peripheral Interface. It is used to send data quickly between microcontrollers and small peripherals like sensors, SD cards, or displays.
Click to reveal answer
beginner
How do you start using the SPI library in an Arduino sketch?
You include the SPI library with
#include <SPI.h> and then call SPI.begin(); in the setup() function to initialize the SPI bus.Click to reveal answer
beginner
What is the role of the
SPI.transfer() function?SPI.transfer() sends a byte of data to the SPI device and simultaneously receives a byte back. It is the main way to communicate over SPI.Click to reveal answer
intermediate
Why do you need to control the Chip Select (CS) pin manually in SPI communication?
The CS pin tells the SPI device when to listen or ignore data. You set it LOW before communication and HIGH after to start and stop talking to the device.
Click to reveal answer
intermediate
How can you change the SPI clock speed and data order in Arduino?
Use
SPI.beginTransaction() with an SPISettings object to set clock speed, bit order (MSBFIRST or LSBFIRST), and data mode (clock polarity and phase).Click to reveal answer
Which Arduino function initializes the SPI bus?
✗ Incorrect
The correct function to initialize SPI communication is SPI.begin().
What does SPI.transfer() do?
✗ Incorrect
SPI.transfer() sends one byte and simultaneously receives one byte from the SPI device.
Why do you set the Chip Select (CS) pin LOW before SPI communication?
✗ Incorrect
Setting CS LOW signals the device to listen and start communication.
Which of these is NOT a parameter you can set with SPISettings?
✗ Incorrect
Baud rate is for UART, not SPI. SPISettings controls clock speed, bit order, and data mode.
What must you do after finishing SPI communication with a device?
✗ Incorrect
Setting the CS pin HIGH tells the device communication is finished.
Explain the basic steps to communicate with a device using the SPI library on Arduino.
Think about setup, starting communication, sending data, and ending communication.
You got /5 concepts.
Describe how to configure SPI speed and data order for a device that requires specific settings.
Focus on SPISettings and transaction control.
You got /5 concepts.
