SPI

Description

This library allows you to communicate with SPI devices, with the Arduino board as the controller device. This library is bundled with every Arduino platform (avr, megaavr, mbed, samd, sam, arc32), so you do not need to install the library separately.

To use this library

#include <SPI.h>

To read more about Arduino and SPI, you can visit the Arduino & Serial Peripheral Interface (SPI) guide.

BoardsDefault SPI PinsAdditional SPI PinsNotes
UNO R3, UNO R3 SMD, UNO WiFi Rev2, UNO Mini LE10(CS), 11(COPI), 12(CIPO), 13(SCK)SPI pins available on ICSP header
UNO R4 Minima, UNO R4 WiFi10(CS), 11(COPI), 12(CIPO), 13(SCK)SPI pins available on ICSP header
Leonardo, Yún Rev2, Zero10(CS), 11(COPI), 12(CIPO), 13(SCK)SPI pins available on ICSP header
Micro14(CIPO), 15(SCK), 16(COPI)
Nano boards11(COPI), 12(CIPO), 13(SCK)
MKR boards8(COPI), 9(SCK), 10(CIPO)
Due74(CIPO), 75(MOSI), 76(SCK)SPI pins available on dedicated SPI header
GIGA R1 WiFi89(CIPO), 90(COPI), 91(SCK)12(CIPO), 11(COPI), 13(SCK), 10(CS)Note that pin 89, 90, 91 are located on the SPI header
Mega 2560 Rev350(CIPO), 51(COPI), 52(SCK), 53(CS)SPI pins available on ICSP header

Functions

Suggest changes

The content on docs.arduino.cc is facilitated through a public GitHub repository. If you see anything wrong, you can edit this page here.

License

The Arduino documentation is licensed under the Creative Commons Attribution-Share Alike 4.0 license.