Reference   Language | Libraries | Comparison | Changes

CurieIMU

setDetectionDuration()

Description

Sets the value of the detection duration or waiting window for the selected feature

Syntax

CurieIMU.setDetectionDuration(int feature, float value)

Parameters

feature: the requested feature. It can assume one of these values:

  • CURIE_IMU_FREEFALL
  • CURIE_IMU_SHOCK
  • CURIE_IMU_MOTION
  • CURIE_IMU_ZERO_MOTION
  • CURIE_IMU_DOUBLE_TAP
  • CURIE_IMU_TAP_SHOCK
  • CURIE_IMU_TAP_QUIET

value: the value to be set for each of the features. Some features allow a specific set of values as stated below:

CURIE_IMU_FREEFALL – interval of continuous 0g reading to trigger the interrupt
2.5 to 637.5 ms, in steps of 2.5 ms

CURIE_IMU_SHOCK - The duration of the shock (high-g) condition needed to trigger the interrupt; the sign of high-g must not change during the duration.
50, 75 ms

CURIE_IMU_MOTION - The number of consecutive samples where the threshold value must be exceeded to trigger the interrupt. To get the time correspondent to the samples, divide them by the sampling rate. The value calculated is in seconds.
from 1 to 4

CURIE_IMU_ZERO_MOTION - The amount of time where the acceleration read on any of the three axis must stay below the trigger level to activate the interrupt. The value is stored as six bit and is used with a multiplying factor of 1.28, 5.12 or 10.24 seconds.
1.28, 2.56, 3.84, 5.12, 6.40, 7.68, 8.96, 10.24, 11.52, 12.80, 14.08, 15.36, 16.64, 17.92, 19.20, 20.48, 25.60, 30.72, 35.84, 40.96, 46.08, 51.20, 56.32, 61.44, 66.56, 71.68, 76.80, 81.92, 87.04, 92.16, 97.28, 102.40, 112.64, 122.88, 133.12, 143.36, 153.60, 163.84, 174.08, 184.32, 194.56, 204.80, 215.04, 225.28, 235.52, 245.76, 256.00, 266.24, 276.48, 286.72, 296.96, 307.20, 317.44, 327.68, 337.92, 348.16, 358.40, 368.64, 378.88, 389.12, 399.36, 409.60, 419.84, 430.08 S

CURIE_IMU_DOUBLE_TAP – waiting window for the second tap to be read
50, 100, 150, 200, 250, 275, 500, 700 ms

CURIE_IMU_TAP_SHOCK - The time a phisical shocking event should happen, exceeding the set threshold, to trigger the interrupt.
50, 75 ms

CURIE_IMU_TAP_QUIET – The time the acceleration reading should stay low to separate two taps.
20, 30 ms

See also

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.