I am unable to change the SPI clock rate regardless of what parameter i use for setClockDivider().
Code is below.
int CS = D0;
void setup() {
pinMode(CS,OUTPUT);
digitalWrite(CS, HIGH );
// Prove to me that this latest example has been
// downloaded
Serial1.begin(115200);
Serial1.println("SPI Test 0.5");
//MSBFIRST
//LSBFIRST
SPI.setBitOrder(LSBFIRST);
//SPI_CLOCK_DIV2
//SPI_CLOCK_DIV4
//SPI_CLOCK_DIV8
//SPI_CLOCK_DIV16
//SPI_CLOCK_DIV32
//SPI_CLOCK_DIV64
//SPI_CLOCK_DIV128
//SPI_CLOCK_DIV256
SPI.setClockDivider(SPI_CLOCK_DIV256);
//SPI_MODE0
//SPI_MODE1
//SPI_MODE2
//SPI_MODE3
SPI.setClockDivider(SPI_MODE0);
// initialise it
SPI.begin();
}
void loop() {
// Bring my CS pin low
digitalWrite(CS, LOW );
// Send some data
SPI.transfer(0xa5);
// Bring my CS pin high
digitalWrite(CS, HIGH );
delay(10);
}