Skip to content

This is a example using accelerometer adxl345 with ESP23 under ESP-IDF

Notifications You must be signed in to change notification settings

EricLin0123/esp-idf-adxl345

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ESP-IDF-ADXL345

This is an example of adxl345 accelerometer controlled by ESP32 under ESP-IDF

How to start

Set up the environment variables.(if you followed the official doc)

. $HOME/esp/esp-idf/export.sh

Go to the /example directory (/esp-idf-adxl345/example) and configure the project. My target is esp32

idf.py set-target esp32
idf.py menuconfig

Build

idf.py build

flash and monitor

idf.py -p PORT flash monitor

PORT is something like /dev/ttyUSB0, you can check it out by

ls /dev/tty*

Expected output

I (339) SYSTEM: INTERFACE is i2c
I (339) SYSTEM: CONFIG_SDA_GPIO=21
I (349) SYSTEM: CONFIG_SCL_GPIO=22
I (349) ADXL345: devid=e5
I (349) ADXL345: ADXL345 set to measure mode
I (359) ADXL345: x=5, y=-14, z=244
I (459) ADXL345: x=5, y=-13, z=244
I (559) ADXL345: x=6, y=-13, z=244
I (659) ADXL345: x=5, y=-13, z=244
I (759) ADXL345: x=4, y=-13, z=245
I (859) ADXL345: x=5, y=-13, z=243
I (959) ADXL345: x=5, y=-13, z=244
I (1059) ADXL345: x=6, y=-13, z=245

License

MIT

About

This is a example using accelerometer adxl345 with ESP23 under ESP-IDF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published