From 33c6e45db525d18462819b2d205807dd06152872 Mon Sep 17 00:00:00 2001 From: William Clark Date: Sun, 7 Jan 2024 17:31:20 +0000 Subject: [PATCH] README --- README.md | 1 + example/README.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5321ab9..e98fafa 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ A C89 driver for the 3-axis accelerometer LIS3DH. Supports both I2C and SPI. > - Single-click detection > - Double-click detection > - 4D/6D orientation detection +> - Sleep-to-Wake/Return-to-Sleep ## Examples diff --git a/example/README.md b/example/README.md index 1a79e73..11d7c8f 100644 --- a/example/README.md +++ b/example/README.md @@ -129,10 +129,10 @@ Inertial interrupt example, the interrupt line is kept active so long as the dev # "Sleep to Wake" and "Return to Sleep" -The LIS3DH can be programmed to automatically switch to `LP` mode upon recognition of a specific event. Once the event is over, the device will return to whatever mode it was in before the event. +The LIS3DH can be programmed to automatically enter a slow, low-power mode until it detects a specific event (acceleration exceeding `threshold`). Then, it will enter the mode set in `cfg.{mode,rate}` and behave as normal, until the `duration` since the beginning of sensing event has elapsed. -When the experienced acceleration [OR combination of all axes] falls below the `threshold` value stored in `cfg.act_ths`, the device automatically switches to `LP` mode with an ODR of 10 Hz. The duration of "normal function", the Wake period duration, is specified in `cfg.act_dur`. +The device, if configured with any non-zero values in `cfg.act_ths` and `cfg.act_dur` immediately enters low-power mode and will remain so until it experiences an acceleration [OR combination of all axes] that exceeds `threshold`. Upon experiencing such an acceleration, the device will activate `INT2` (configurable) and for a period of time (specified in `cfg.act_dur`) behave as normal, i.e. use the mode set in `cfg`. -As soon as the experienced acceleration rises above the threshold, the device restores the original mode and ODR. +When the time period (specified in `cfg.act_dur`) has elapsed, the device will trigger on `INT2` (configurable) again, and enter low-power mode. This cycle continues indefinitely. See file: `sleep-to-wake.c`. \ No newline at end of file