Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# LIS3DHH
Arduino library to support the LIS3DHH 3D accelerometer

## API

This sensor uses SPI to communicate.

For SPI it is then required to create a SPI interface before accessing to the sensors:

dev_spi = new SPIClass(SPI_MOSI, SPI_MISO, SPI_SCK);
dev_spi->begin();

An instance can be created and enabled when the SPI bus is used following the procedure below:

Accelero = new LIS3DHHSensor(dev_spi, CS_PIN);
Accelero->Enable_X();

The access to the sensor values is done as explained below:

Read accelerometer.

Accelero->Get_X_Axes(&accelerometer);

## Documentation

You can find the source files at
https://github.com/stm32duino/LIS3DHH

The LIS3DHH datasheet is available at
https://www.st.com/content/st_com/en/products/mems-and-sensors/accelerometers/lis3dhh.html
38 changes: 38 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#######################################
# Syntax Coloring Map For LIS3DHH
#######################################

#######################################
# Datatypes (KEYWORD1)
#######################################

LIS3DHHSensor KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

Enable_X KEYWORD2
Disable_X KEYWORD2
ReadID KEYWORD2
Get_X_Axes KEYWORD2
Get_X_Sensitivity KEYWORD2
Get_X_AxesRaw KEYWORD2
Get_X_ODR KEYWORD2
Set_X_ODR KEYWORD2
Get_X_FS KEYWORD2
Set_X_FS KEYWORD2
Enable_DRDY_Interrupt KEYWORD2
Disable_DRDY_Interrupt KEYWORD2
Set_Filter_Mode KEYWORD2
Get_DRDY_Status KEYWORD2
Get_FIFO_Num_Samples KEYWORD2
Set_FIFO_Mode KEYWORD2
ReadReg KEYWORD2
WriteReg KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################

LIS3DHH_ACC_SENSITIVITY LITERAL1
9 changes: 9 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=STM32duino LIS3DHH
version=1.0.0
author=SRA
maintainer=stm32duino
sentence=Ultra High Resolution 3D accelerometer.
paragraph=This library provides Arduino support for the ultra high resolution 3D accelerometer LIS3DHH for STM32 boards.
category=Sensors
url=https://github.com/stm32duino/LIS3DHH
architectures=stm32, avr, sam
Loading