File tree 4 files changed +10
-10
lines changed
libraries/CurieImu/examples
4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ void setup() {
108
108
Serial.println (CurieIMU.getGyroOffset (Z_AXIS));
109
109
110
110
Serial.println (" Enabling Gyroscope/Acceleration offset compensation" );
111
- CurieIMU.enableGyroOffset (false );
111
+ CurieIMU.enableGyroOffset (true );
112
112
CurieIMU.enableAccelerometerOffset (true );
113
113
114
114
Serial.println (CurieIMU.accelerometerOffsetEnabled ());
@@ -152,4 +152,4 @@ void loop() {
152
152
// blink LED to indicate activity
153
153
blinkState = !blinkState;
154
154
digitalWrite (ledPin, blinkState);
155
- }
155
+ }
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ void setup() {
35
35
36
36
/* Enable Shock Detection */
37
37
CurieIMU.setDetectionThreshold (CURIE_IMU_SHOCK, 192 ); // 1.5g
38
- CurieIMU.setDetectionDuration (CURIE_IMU_SHOCK,11 ); // 30ms
39
- CurieIMU.enableInterrupt (CURIE_IMU_SHOCK,true );
38
+ CurieIMU.setDetectionDuration (CURIE_IMU_SHOCK, CURIE_IMU_TAP_SHOCK_DURATION_50MS ); // 50ms
39
+ CurieIMU.enableInterrupt (CURIE_IMU_SHOCK, true );
40
40
41
41
/* Enable Interrupts Notifications */
42
42
CurieIMU.setIntEnabled (true );
@@ -68,4 +68,4 @@ static void eventCallback(void)
68
68
if (CurieIMU.shockDetected (Z_AXIS,NEGATIVE))
69
69
Serial.println (" Positive shock detected on Z-axis" );
70
70
}
71
- }
71
+ }
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ void setup() {
52
52
// attach the eventCallback function as the
53
53
// step event handler:
54
54
CurieIMU.attachInterrupt (eventCallback);
55
- CurieIMU.enableInterrupt (CURIE_IMU_STEP,true ); // turn on step detection
55
+ CurieIMU.enableInterrupt (CURIE_IMU_STEP, true ); // turn on step detection
56
56
CurieIMU.setIntEnabled (true ); // enable interrupts
57
57
58
58
Serial.println (" IMU initialisation complete, waiting for events..." );
Original file line number Diff line number Diff line change @@ -32,16 +32,16 @@ void setup() {
32
32
CurieIMU.attachInterrupt (eventCallback);
33
33
34
34
// Increase Accelerometer range to allow detection of stronger taps (< 4g)
35
- CurieIMU.setAccelerometerRange (4 );
35
+ CurieIMU.setAccelerometerRange (CURIE_IMU_ACCELEROMETER_RANGE_4G );
36
36
37
37
// Reduce threshold to allow detection of weaker taps (>= 750mg)
38
- CurieIMU.setDetectionThreshold (CURIE_IMU_TAP,6 ); // (6 x 125mg)
38
+ CurieIMU.setDetectionThreshold (CURIE_IMU_TAP, 6 ); // (6 x 125mg)
39
39
40
40
// Set the time window for 2 taps to be registered as a double-tap (<= 250 milliseconds)
41
- CurieIMU.setDetectionDuration (CURIE_IMU_DOUBLE_TAP,250 );
41
+ CurieIMU.setDetectionDuration (CURIE_IMU_DOUBLE_TAP, CURIE_IMU_DOUBLE_TAP_DURATION_250MS );
42
42
43
43
// Enable Double-Tap detection
44
- CurieIMU.enableInterrupt (CURIE_IMU_DOUBLE_TAP,true );
44
+ CurieIMU.enableInterrupt (CURIE_IMU_DOUBLE_TAP, true );
45
45
46
46
// Enable Interrupts Notifications
47
47
CurieIMU.setIntEnabled (true );
You can’t perform that action at this time.
0 commit comments