Check if a shake was detected. All of the arguments for this function are both inputs and outputs.
This will return if the shake state changed, not if it is shaking or not. The argument isShook
will contain the shake state.
This calls accelIntegrate() and accelGetAccelVecRaw(), so neither of those functions needs to be called elsewhere. Because this function calls accelIntegrate(), it should be called relatively frequently.
- Parameters
-
lastOrientation | The last IMU orientation, should only be set by this function |
shakeHistory | A list of shake values to see when the Swadge settles |
isShook | true if the Swadge is shaking, false if it is not |
- Returns
- true if the shake state changed (no shake to shake or vice versa), false if it did not