How to change Arduino Uno SPI speed?

Hello. How can I change SPI speed on Arduino Uno? My goal is to set it to half the system clock.

From the Sparkfun SPI page (found with google search for "arduino spi set speed").

SPI can operate at extremely high speeds (millions of bytes per second), which may be too fast for some devices. To accommodate such devices, you can adjust the data rate. In the Arduino SPI library, the speed is set by the setClockDivider() function, which divides the controller clock (16MHz on most Arduinos) down to a frequency between 8MHz (/2) and 125kHz (/128).

Arduino SPI reference
SPI.setClockDivider().

"SPI.setClockDivider()" throws an error during compilation. "SPI.beginTransaction()" doesn't work for me as it disables interrupts.

Please post the formatted code in a code block.

Please post the entire error message.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.