Mercurial > public > ostc4
comparison Discovery/Inc/motion.h @ 373:7b981f8bdd41 MotionDetection
Add scroll event by pitch angle detection:
Add a function to scroll through the custom view in case the computer is not in the typical center position
Refine Pitch Detection:
Changed implementation to use sectors for detection. Increased detection window
author | ideenmodellierer |
---|---|
date | Sun, 08 Sep 2019 13:45:17 +0200 |
parents | fca370f847f8 |
children | 4bb5ceebfaf9 |
comparison
equal
deleted
inserted
replaced
372:75eedde05ff6 | 373:7b981f8bdd41 |
---|---|
8 #ifndef INC_MOTION_H_ | 8 #ifndef INC_MOTION_H_ |
9 #define INC_MOTION_H_ | 9 #define INC_MOTION_H_ |
10 | 10 |
11 | 11 |
12 /* exported data types */ | 12 /* exported data types */ |
13 #define CUSTOMER_DEFINED_VIEWS (100u) /* value will cause the function to detect the numer of selected views */ | 13 #define CUSTOMER_DEFINED_VIEWS (100u) /* value will cause the function to detect the number of selected views */ |
14 #define CUSTOMER_KEEP_LAST_SECTORS (200u) /* do not update number of sectors, just define the new center position */ | |
14 | 15 |
15 typedef enum | 16 typedef enum |
16 { | 17 { |
17 MOTION_DETECT_OFF = 0, | 18 MOTION_DETECT_OFF = 0, |
18 MOTION_DETECT_SECTOR, | 19 MOTION_DETECT_SECTOR, |
19 MOTION_DETECT_MOVE | 20 MOTION_DETECT_MOVE, |
21 MOTION_DETECT_SCROLL | |
20 } MotionDetectMethod_t; | 22 } MotionDetectMethod_t; |
21 | 23 |
22 typedef enum | 24 typedef enum |
23 { | 25 { |
24 DETECT_START = 0, | 26 DETECT_START = 0, |
41 | 43 |
42 void InitMotionDetection(void); | 44 void InitMotionDetection(void); |
43 void DefinePitchSectors(float centerAngle, uint8_t numOfSectors); | 45 void DefinePitchSectors(float centerAngle, uint8_t numOfSectors); |
44 detectionState_t detectPitch(float currentPitch); | 46 detectionState_t detectPitch(float currentPitch); |
45 detectionState_t detectSectorButtonEvent(float curPitch); | 47 detectionState_t detectSectorButtonEvent(float curPitch); |
48 detectionState_t detectScrollButtonEvent(float curPitch); | |
46 | 49 |
47 #endif /* INC_MOTION_H_ */ | 50 #endif /* INC_MOTION_H_ */ |