|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
Macros | |
| #define | SHAKE_THRESHOLD 300 |
| #define | SHAKE_HYSTERESIS 10 |
Functions | |
| bool | checkForShake (vec3d_t *lastOrientation, list_t *shakeHistory, bool *isShook) |
| Check if a shake was detected. All of the arguments for this function are both inputs and outputs. | |
| #define SHAKE_THRESHOLD 300 |
| #define SHAKE_HYSTERESIS 10 |
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.
| 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 |