Communicate by ESP32 with LIS35DE 3-axis motion sensor using SPI interface
Communicate by ESP32 with LIS35DE 3-axis motion sensor using SPI interface.
Signal Name | Sensor | ESP32 |
---|---|---|
Slave Select | SS | GPIO22 |
Serial Clock | SCK | GPIO18 |
Master Out Slave In | MOSI | GPIO23 |
Master In Slave Out | MISO | GPIO19 |
Please follow ESP32 Get Started.
I (257) LIS35DE Example: Starting example
I (257) LIS35DE Driver: Initialize SPI
I (257) LIS35DE Driver: Initialize the LIS35DE sensor
I (267) LIS35DE Driver: Power up and enable all three axis
I (277) LIS35DE Driver: Check if sensor responds...
I (277) LIS35DE Driver: Sensor responded correctly
I (287) LIS35DE Example: x: -1, y: 3, z: 53
I (487) LIS35DE Example: x: 1, y: 3, z: 53
I (687) LIS35DE Example: x: 0, y: 4, z: 52
Z axis position">
Picture above shows an example SPI transaction reading sensors XZ axis position. To do so, we are using an option
LIS35_ADDR_INC
to automatically increment register address and retrieving axis position in a single SPI transaction.
Feel free to contribute to the project in any way you like!
If you find any issues with code or description please report them using Issues tab above.
This repository has been prepared thanks to great work of the following teams and individuals: