Releases: wollewald/ADXL345_WE
SPI clock speed can now be set
I embedded the SPI transaction in SPI.beginTransaction(SPISetttings(clock, MSBFIRST, SPI_MODE3)) and SPI.endTransaction().
The clock can be set using the new setSPIClockSpeed(unsigned long) function.
Added setAngleOffsets and getAngleOffsets functions
With these function you can get and set the angleOffsets. The offset is an xyzFloat.
Fixed a bug in setInterruptPolarity
If forgot to finally write the pority into the register.
FIFO Settings more robust now
When using setFifoParameters after setFifoMode, the mode was overwritten to bypass. This is now changed and the order of the two functions are not relevant anymore.
SPI now implemented
I have added SPI functionality to the library. SPI is faster and needed in case you need high data rates.
Read performance increase
In the readRegister functions, I have added a "false" in Wire.endTransmission() ---> Wire.endTransmission(false) before Wire.requestFrom(). This saves some microseconds.
TwoWire object can now be passed to the constructor
There are now several ways to create your ADXL345 object:
- ADXL345_WE myAcc = ADXL345_WE() -> uses Wire / I2C Address = 0x53
- ADXL345_WE myAcc = ADXL345_WE(ADXL345_I2CADDR) -> uses Wire / ADXL345_I2CADDR
- ADXL345_WE myAcc = ADXL345_WE(&wire2) -> uses the TwoWire object wire2 / ADXL345_I2CADDR
- ADXL345_WE myAcc = ADXL345_WE(&wire2, ADXL345_I2CADDR) -> all together
So now you are able to use the two I2C busses of ESP32 boards.
Corrected few typos
No change to the code - only few typos in comments of example sketches.
FIFO reworked - now 32 x,y,z values available
In previous versions only 32 single values were available. I had ignored that the FIFO buffer needs to be read in a different way (multiple byte read). This is described in the Application Note AN 1025. The example sketches have also been changed accordingly.
Furthermore I have changed tabs in to spaces, since I have noticed that some people have problems with tabs.
Deleted a redundant line in init()
Just deleted one redundant line in init();