I am using the intel Galileo board. I notice that no matter what parameter i use for the SPI.setClockDivider(); it does not change the clock rate. why ?
This is the code.
// inslude the SPI library:
#include <SPI.h>
// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;
void setup()
{
Serial.begin(115200);
// set the slaveSelectPin as an output:
pinMode (slaveSelectPin, OUTPUT);
SPI.setClockDivider(SPI_CLOCK_DIV128);
//mode: SPI_MODE0, SPI_MODE1, SPI_MODE2, or SPI_MODE3
SPI.setDataMode(SPI_MODE0);
//order: either LSBFIRST or MSBFIRST
SPI.setBitOrder(LSBFIRST);
// initialize SPI:
SPI.begin();
}
void loop()
{
// take the SS pin low to select the chip:
digitalWrite(slaveSelectPin,LOW);
// send in the address and value via SPI:
SPI.transfer(0xa5);
// take the SS pin high to de-select the chip:
digitalWrite(slaveSelectPin,HIGH);
Serial.print("Spi Sent\r\n");
delay(100);
}