Skip to content

ADXL345 3-Axis Accelerometer Library for STM32. HAL-Compatible.

License

Notifications You must be signed in to change notification settings

AlexandrTurok/STM32-ADXL345

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

STM32-ADXL345

ADXL345 3-Axis Accelerometer Library for STM32. HAL-Compatible.

How to use this library

-- In ADXL.h

1- Change the HAL library header file according to your uC. Here STM32L1xx and hence #include "stm32l1xx_hal.h" is used.

2- Update the SPI settings. Here HAL library is utilized. If you are using STM32CubeMX, set SPI settings and change the handler here, i.e. hspiX.

3- Set the CS pin and port.

-- In main.c

4- Define an ADXL_InitTypeDef structure and set appropriate elements. Full explanation exists in ADXL.h and ADXL.c files. You can also refer to ADXL345 datasheet.

5- Define an adxlStatus variable.

6- Add ADXL_Init() functions. Its output should be ADXL_OK, otherwise there is some problems.

7- Use other functions like ADXL_Measure(ON) and ADXL_getAccel() as mentioned in the library files.

About

ADXL345 3-Axis Accelerometer Library for STM32. HAL-Compatible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%