Configure parameters for "click" (tap) detection. See datasheet for explanation of parameters: http://www.st.com/resource/en/application_note/cd00290365.pdf
set-click
@/set-click
Configure parameters for "click" (tap) detection. See datasheet for explanation of parameters: http://www.st.com/resource/en/application_note/cd00290365.pdf
DEV@/lis3dh-device-spi
A lis3dh device.
MODEbyte
Mode. Options: 0 = turn off click detection & interrupt; 1 = single click only interrupt output; 2 = double click only interrupt output, detect single click.
THRESHOLDbyte
Adjust this number for the sensitivity of the 'click' force. This strongly depends on the range! For 16G, try 5-10; for 8G, try 10-20; for 4G, try 20-40; for 2G, try 40-80.
T-LIMITbyte
Time limit (default = 10). To convert to seconds divide by data rate. For example, if the data rate is 400Hz, then the default value of 10 is equivalent to a time limit of 25 ms.
T-LATENCYbyte
Time latency (default = 20). To convert to seconds divide by data rate. For example, if the data rate is 400Hz, then the default value of 20 is equivalent to a latency of 50 ms.
T-WINDOWbyte
Time window (default = 255). To convert to seconds divide by data rate. For example, if the data rate is 400Hz, then the default value of 255 is equivalent to a time window of 637.5 ms.
UPDpulse
Update.
DONEpulse
Pulse on completion.
To use the node in your project you should have the wayland/lis3dh-accelerometer-spi library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isInputDirty<input_UPD>(ctx))
return;
// Get a pointer to the `Adafruit_LIS3DH` class instance
auto sensor = getValue<input_DEV>(ctx);
sensor->setClick(getValue<input_MODE>(ctx),
getValue<input_THRESHOLD>(ctx),
getValue<input_T_LIMIT>(ctx),
getValue<input_T_LATENCY>(ctx),
getValue<input_T_WINDOW>(ctx));
emitValue<output_DONE>(ctx, 1);
}