lis3dh/example/README.md

16 lines
1.0 KiB
Markdown
Raw Normal View History

2023-12-30 13:10:40 +00:00
# lis3dh/example
### simple.c
2023-12-30 13:10:40 +00:00
Basic examples of how to use this device
### fifo.c
2023-12-30 13:10:40 +00:00
Instead of polling for every single [x y z] set, a FIFO with programmable capacity ("watermark") can be used like such: All FIFO readings use 10-bit resolution regardless of the mode set in `lis.cfg.mode`. The watermark level can also be adjusted to a value [0-31] inclusive by modifying the `lis.cfg.fifo.fth` property before calling configure().
The LIS3DH can optionally apply a HP filter on the sample data. It can be used to greatly reduce the "DC acceleration" present.
### interrupts.c
2023-12-30 13:10:40 +00:00
The LIS3DH supports two different interrupt "output pins," `INT1` and `INT2`. The appropriate flag must be set in either `cfg.int1` or `cfg.int2` (only one of such flags can be set at a time!) and the interrupt source must be configured to trigger into `INT1` or `INT2`. Below is example code that listens and receives an interrupt when the FIFO watermark is reached i.e. it is full.
### single-click.c
Set up single-click detection using HP filter