ADXL313 not working with ardouino

hello everyone ,

ADXL313 library is working only with ESP32 , but its not working with arduino uno.

whenever i try to upload the sketch i get this message :

In member function ‘boolean ADXL313::beginSPI(uint8_t, SPIClass&)’:

error: no matching function for call to ‘SPIClass::begin(int&)’

_spiPort->begin(_CS);

static void begin();

what is the problem ?

Where did you download the library from? Here?

https://www.arduino.cc/reference/en/lib … o-library/

Hi!

I have the same issue.

I was using the library “SparkFun_ADXL313_Arduino_Library-1.0.2” from the following link:

https://www.arduino.cc/reference/en/lib … o-library/

would be great if somebody could help…

THX

Constantin

you can not pass a chip select pin. with a begin call. The ChipSelect pin is “hard” defined in the variant as ‘SS’ . it will work if you change

_spiPort->begin(_CS); 

to

_spiPort->begin();

I hope that is enough as by doing a quick look at the code I see it is using an old style of interacting with the SPI library. The Arduino AVR library has some backward-compatible calls and that might be enough for this work.

Thank you for the fast response!

I must admit that my knowledge is not that professional :wink: how it should be…

I changed the call of the function in “SparkFunADXL313.cpp” and “SparkFunADXL313.h” but then other compiler errors occur.

Basically, want to communicate with the module via i2C and I’m running one of the examples “Example1_BasicReadings.ino” that are delivered.

I was wondering if I’m doing something completely wrong, but all other sensor (e.g. BME680) are working fine…

THX Constantin