1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | #import <UIKit/UIKit.h> |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | #ifdef __CORE_MOTION__ |
---|
17 | #import <CoreMotion/CoreMotion.h> |
---|
18 | Boolean CORE_MOTION = true; |
---|
19 | #else |
---|
20 | Boolean CORE_MOTION = false; |
---|
21 | #endif |
---|
22 | |
---|
23 | double defaultControlThrottle = 0.8; |
---|
24 | double defaultControlYaw = 0.47; |
---|
25 | double defaultControlPitch = 0.31; |
---|
26 | |
---|
27 | double referenceTiltX = 0; |
---|
28 | double referenceTiltY = 0; |
---|
29 | double titleSensorMinimumThreshold = 0.01; |
---|
30 | |
---|
31 | @interface AdvancedViewController : UIViewController |
---|
32 | |
---|
33 | @property (nonatomic, retain) IBOutlet UIBarButtonItem *resetButton; |
---|
34 | |
---|
35 | @property (nonatomic, retain) IBOutlet UILabel *throttlePercent; |
---|
36 | @property (nonatomic, retain) IBOutlet UISlider *throttle; |
---|
37 | @property (nonatomic, retain) IBOutlet UILabel *yawPercent; |
---|
38 | @property (nonatomic, retain) IBOutlet UISlider *yaw; |
---|
39 | @property (nonatomic, retain) IBOutlet UILabel *pitchPercent; |
---|
40 | @property (nonatomic, retain) IBOutlet UISlider *pitch; |
---|
41 | |
---|
42 | @property (nonatomic, retain) IBOutlet UILabel *presets; |
---|
43 | @property (nonatomic, retain) IBOutlet UIButton *buttonHover; |
---|
44 | @property (nonatomic, retain) IBOutlet UIButton *buttonForward; |
---|
45 | @property (nonatomic, retain) IBOutlet UIButton *buttonLeft; |
---|
46 | @property (nonatomic, retain) IBOutlet UIButton *buttonRight; |
---|
47 | |
---|
48 | @property (nonatomic, retain) IBOutlet UILabel *tiltSensorControl; |
---|
49 | @property (nonatomic, retain) IBOutlet UISwitch *switchTiltSensorControl; |
---|
50 | @property (nonatomic, retain) IBOutlet UILabel *tiltSensorControlThrottle; |
---|
51 | @property (nonatomic, retain) IBOutlet UISwitch *switchTiltSensorControlThrottle; |
---|
52 | |
---|
53 | - (IBAction) resetButtonPressed:(id)button; |
---|
54 | |
---|
55 | - (IBAction) pitchChanged:(id)sender; |
---|
56 | - (IBAction) yawChanged:(id)sender; |
---|
57 | - (IBAction) throttleChanged:(id)sender; |
---|
58 | |
---|
59 | - (IBAction) hoverButtonPressed:(id)sender; |
---|
60 | - (IBAction) forwardButtonPressed:(id)sender; |
---|
61 | - (IBAction) leftButtonPressed:(id)sender; |
---|
62 | - (IBAction) rightButtonPressed:(id)sender; |
---|
63 | |
---|
64 | - (IBAction) changeSwitchTiltSensorControl:(id)sender; |
---|
65 | - (IBAction) changeSwitchTiltSensorControlThrottle:(id)sender; |
---|
66 | |
---|
67 | #ifdef __CORE_MOTION__ |
---|
68 | @property (strong, nonatomic) CMMotionManager *motionManager; |
---|
69 | #endif |
---|
70 | |
---|
71 | @end |
---|