LSM9DS1 Arduino Basic SPI Example Compile Error

A novice question. I’m getting the following error when compiling the LSM9DS1_Basic_SPI example for the Redbord Artemis ATP. Can anyone tell me what the problem is. Thanks.

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: “RedBoard Artemis ATP, 921600, SparkFun Variable Loader (Recommended)”

C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp: In member function ‘void LSM9DS1::initSPI()’:

C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp:1141:6: error: ‘class arduino::MbedSPI’ has no member named ‘setClockDivider’

SPI.setClockDivider(SPI_CLOCK_DIV2);

^~~~~~~~~~~~~~~

C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp:1141:22: error: ‘SPI_CLOCK_DIV2’ was not declared in this scope

SPI.setClockDivider(SPI_CLOCK_DIV2);

^~~~~~~~~~~~~~

C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp:1141:22: note: suggested alternative: ‘SPI_CLK’

SPI.setClockDivider(SPI_CLOCK_DIV2);

^~~~~~~~~~~~~~

SPI_CLK

C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp:1143:6: error: ‘class arduino::MbedSPI’ has no member named ‘setBitOrder’

SPI.setBitOrder(MSBFIRST);

^~~~~~~~~~~

C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp:1146:6: error: ‘class arduino::MbedSPI’ has no member named ‘setDataMode’

SPI.setDataMode(SPI_MODE0);

^~~~~~~~~~~

exit status 1

Error compiling for board RedBoard Artemis ATP.

This is because these calls are not available for SPI in library 2.0.6. you need to make a change in the library In file: :```
C:\Users\Stephen\OneDrive\Documents\Arduino\libraries\SparkFun_LSM9DS1_Arduino_Library-master\src\SparkFunLSM9DS1.cpp


Starting line 1141, change :

// Maximum SPI frequency is 10MHz, could divide by 2 here:
SPI.setClockDivider(SPI_CLOCK_DIV2);
// Data is read and written MSb first.
SPI.setBitOrder(MSBFIRST);
// Data is captured on rising edge of clock (CPHA = 0)
// Base value of the clock is HIGH (CPOL = 1)
SPI.setDataMode(SPI_MODE0);

to 

/* commenting out as not available in 2.0.6

// Maximum SPI frequency is 10MHz, could divide by 2 here:
SPI.setClockDivider(SPI_CLOCK_DIV2);
// Data is read and written MSb first.
SPI.setBitOrder(MSBFIRST);
// Data is captured on rising edge of clock (CPHA = 0)
// Base value of the clock is HIGH (CPOL = 1)
SPI.setDataMode(SPI_MODE0);

*/
// needed on 2.0.6
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));

Thanks Paul, that’s helpful.