You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arduino\libraries\SparkFun_ADXL313_Arduino_Library\src\SparkFunADXL313.cpp: In member function 'boolean ADXL313::beginSPI(uint8_t, arduino::SPIClass&)':
Arduino\libraries\SparkFun_ADXL313_Arduino_Library\src\SparkFunADXL313.cpp:78:21: error: no matching function for call to 'arduino::HardwareSPI::begin(int&)'
_spiPort->begin(_CS);
^
In file included from Arduino15\packages\SparkFun\hardware\apollo3\2.2.1\libraries\SPI\src/SPI.h:10,
from Arduino\libraries\SparkFun_ADXL313_Arduino_Library\src\SparkFunADXL313.h:46,
from Arduino\libraries\SparkFun_ADXL313_Arduino_Library\src\SparkFunADXL313.cpp:34:
Arduino15\packages\SparkFun\hardware\apollo3\2.2.1/cores/arduino/mbed-bridge/core-api/api/HardwareSPI.h:123:18: note: candidate: 'virtual void arduino::HardwareSPI::begin()'
virtual void begin() = 0;
^~~~~
Arduino15\packages\SparkFun\hardware\apollo3\2.2.1/cores/arduino/mbed-bridge/core-api/api/HardwareSPI.h:123:18: note: candidate expects 0 arguments, 1 provided
Arduino\libraries\SparkFun_ADXL313_Arduino_Library\src\SparkFunADXL313.cpp:79:12: error: 'arduino::SPIClass' {aka 'class arduino::HardwareSPI'} has no member named 'setDataMode'
_spiPort->setDataMode(SPI_MODE3);
^~~~~~~~~~~
exit status 1
Compilation error: exit status 1
The text was updated successfully, but these errors were encountered:
Hi @DesktopMan ,
Thanks for your message here. I was just working on this exact problem (similar Artemis-based hardware) yesterday and found a solution.
The setDataMode() function seems to have become depreciated, so the best way to make it SPI_MODE3 is to pass an SPISettings object inside the SPI function.
You need to make two small adjustments to the header file here:
Here's the code adjustment too, for easier copy/paste.
//_spiPort->begin(_CS); // throws a compile error, no such function
_spiPort->begin();
//_spiPort->setDataMode(SPI_MODE3); // old way of doing SPI settings, now you must pass in an SPISettings object
_spiPort->beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE3));
DesktopMan
changed the title
Compilation error with example 1 on Redboard Artmis
Compilation error with example 1 on Redboard Artemis
Sep 26, 2023
Trying to compile Example1_Basic_Readings.ino:
The text was updated successfully, but these errors were encountered: