项目作者: krzychb

项目描述 :
Communicate by ESP32 with LIS35DE 3-axis motion sensor using SPI interface
高级语言: C
项目地址: git://github.com/krzychb/esp-lis35de.git
创建时间: 2017-12-16T17:14:49Z
项目社区:https://github.com/krzychb/esp-lis35de

开源协议:Apache License 2.0

下载


LIS35DE Motion Sensor Driver Example

Communicate by ESP32 with LIS35DE 3-axis motion sensor using SPI interface.

Build Status

Build Status

Wiring of sensor used in example code

Signal Name Sensor ESP32
Slave Select SS GPIO22
Serial Clock SCK GPIO18
Master Out Slave In MOSI GPIO23
Master In Slave Out MISO GPIO19

How to run this example

Please follow ESP32 Get Started.

Example output

  1. I (257) LIS35DE Example: Starting example
  2. I (257) LIS35DE Driver: Initialize SPI
  3. I (257) LIS35DE Driver: Initialize the LIS35DE sensor
  4. I (267) LIS35DE Driver: Power up and enable all three axis
  5. I (277) LIS35DE Driver: Check if sensor responds...
  6. I (277) LIS35DE Driver: Sensor responded correctly
  7. I (287) LIS35DE Example: x: -1, y: 3, z: 53
  8. I (487) LIS35DE Example: x: 1, y: 3, z: 53
  9. I (687) LIS35DE Example: x: 0, y: 4, z: 52

Example SPI transaction

alt textZ axis position">

Picture above shows an example SPI transaction reading sensors X:Y:Z 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.

Contribute

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.

Credits

This repository has been prepared thanks to great work of the following teams and individuals:

  • Espressif team that develops and maintains esp-idf repository
  • Designer of a handy breakboard KAmodMEMS2 with 3-axis motion sensor providing SPI and I2C interfaces by Kamami

License

Apache License Version 2.0, January 2004