Mercurial > public > ostc4
diff Discovery/Inc/motion.h @ 370:77cdfbdaca8c MotionDetection
Changed function names from shake to pitch and improved detection function: Shake might be confusing for people reading the code because pitch values are ased for calculation => changed name to pitch to be more transparent
author | ideenmodellierer |
---|---|
date | Tue, 13 Aug 2019 21:13:54 +0200 |
parents | bdf978d2a5d4 |
children | fca370f847f8 |
line wrap: on
line diff
--- a/Discovery/Inc/motion.h Tue Aug 13 21:12:17 2019 +0200 +++ b/Discovery/Inc/motion.h Tue Aug 13 21:13:54 2019 +0200 @@ -10,20 +10,37 @@ /* exported data types */ + +typedef enum +{ + MOTION_DETECT_OFF = 0, + MOTION_DETECT_SECTOR, + MOTION_DETECT_MOVE +} MotionDetectMethod_t; + typedef enum { DETECT_START = 0, DETECT_POS_MOVE, DETECT_MAXIMA, DETECT_FALLBACK, - DETECT_POS_SHAKE, + DETECT_POS_PITCH, DETECT_NEG_MOVE, DETECT_MINIMA, DETECT_RISEBACK, - DETECT_NEG_SHAKE, + DETECT_NEG_PITCH, DETECT_NOTHING } detectionState_t; -detectionState_t detectShake(float currentPitch); +typedef struct +{ + float upperlimit; + float lowerlimit; +} SSector; + +void InitMotionDetection(void); +void DefinePitchSectors(float centerAngle); +detectionState_t detectPitch(float currentPitch); +detectionState_t detectSectorButtonEvent(float curPitch); #endif /* INC_MOTION_H_ */