Releases: wollewald/ICM20948_WE
Added a sleep example sketch
I added the example sketch ICM20948_16_sleep.ino to show how to set the ICM20948 and its magnetometer to sleep mode.
Replaced #define by constexpr
Several changes:
- Replaced #define by constexpr
- Replaced private by protected
- Replaced C-cast by static_cast
- Tidied the constructors
Separated xyzFloat definition
If you want to use both an MPU9250 and an ICM20948 in one sketch it won't compile because of the double definition of xyzFloat. I have separated xyzFloat. You can delete xyzFloat.h and xyzFloat.cpp in one of the libraries if you use both.
Changed pitch calculation
I have changed the pitch calculation to a more widely used formula, like here, e.g.:
https://wiki.dfrobot.com/How_to_Use_a_Three-Axis_Accelerometer_for_Tilt_Sensing
SPI clock speed can now be set
I embedded the SPI transaction in SPI.beginTransaction(SPISetttings(clock, MSBFIRST, SPI_MODE0)) and SPI.endTransaction().
The clock can be set using the new setSPIClockSpeed(unsigned long) function.
SPI implementation
You can now also use SPI.
FIFO Reading more efficient now
I had read the FIFO byte by byte, and each reading with a separate begin.Transmission(). I am now reading 6 byte = 1 x,y,z-triple of acceleration or gyroscope data.
Changed circuit
The circuit I had attached before was not correct. VDDIO is 1.71 - 1.95 volts. Therefore a 5 to 3.3 volts level shifter is not sufficient. I corrected this.
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.
Documentation now available
The documentation is now available:
https://wolles-elektronikkiste.de/icm-20948-9-achsensensor-teil-i (German)
https://wolles-elektronikkiste.de/en/icm-20948-9-axis-sensor-part-i (English)
I have put the links into all example sketches and the ICM20948_WE.h / ICM20948_WE.cpp