Syntax
void setClockDivider(
    uint8_t clock_div
);
ContentsIndex
PreviousUpNext
SPIClass::setClockDivider Method
SPIClass Class | Example
Syntax
void setClockDivider(
    uint8_t clock_div
);
Description

Sets up clock divider to control the speed of data transmission.

Parameters
Parameters 
Description 
uint8_t clock_div 
[IN] The clock divider (SPI_CLOCK_DIV2 ~ SPI_CLOCK_DIV128). 
Example
#include <SPI.h>
#define SS_PIN    10

void setup()
{
    pinMode(SS_PIN, OUTPUT);
    SPI.begin(); 
    SPI.setClockDivider(SPI_CLOCK_DIV8); 
}
void loop()
{
    byte ret_val;
    digitalWrite(SS_PIN, LOW);
    ret_val = SPI.transfer(100);
    digitalWrite(SS_PIN, HIGH);
    delay(1000);
}
File

SPI.h

Class