Skip to content

SPI.setDataMode() deprecated #7

Description

@SDAMcIntyre

I was wondering if it would be valuable to update some of the SPI code. I'm referring to lines 49-52 in "SparkFun_ADXL345.cpp":

SPI.begin();
SPI.setDataMode(SPI_MODE3);
pinMode(_CS, OUTPUT);
digitalWrite(_CS, HIGH);

It seems that SPI.setDataMode() is deprecated (https://www.arduino.cc/en/Reference/SPISetDataMode) and that SPISettings(), SPI.beginTransaction() and SPI.endTransaction() should be used in the writeToSPI() and readFromSPI() functions.

Also, is it necessary to pull CS/SS high, since SPI.begin() says it does this already? https://www.arduino.cc/en/Reference/SPIBegin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions