Changeset f45b70a in orbit
- Timestamp:
- 12/31/13 11:03:34 (6 years ago)
- Branches:
- master, Servo
- Children:
- c3d6d63
- Parents:
- af91708
- Location:
- iOS/Orbit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
iOS/Orbit/Orbit/controllers/AdvancedViewController.h
r16249e0 rf45b70a 11 11 12 12 #import <UIKit/UIKit.h> 13 #import <CoreMotion/CoreMotion.h> 13 14 //#define __CORE_MOTION__ 15 16 #ifdef __CORE_MOTION__ 17 #import <CoreMotion/CoreMotion.h> 18 Boolean CORE_MOTION = true; 19 #else 20 Boolean CORE_MOTION = false; 21 #endif 14 22 15 23 double defaultControlThrottle = 0.8; … … 57 65 - (IBAction) changeSwitchTiltSensorControlThrottle:(id)sender; 58 66 59 @property (strong, nonatomic) CMMotionManager *motionManager; 60 67 #ifdef __CORE_MOTION__ 68 @property (strong, nonatomic) CMMotionManager *motionManager; 69 #endif 61 70 62 71 @end -
iOS/Orbit/Orbit/controllers/AdvancedViewController.m
r16249e0 rf45b70a 14 14 #import "AppDelegate.h" 15 15 16 16 17 @implementation AdvancedViewController { 17 18 SignalConverter *signalConverter; … … 29 30 // [alert show]; 30 31 31 self.motionManager = [[CMMotionManager alloc] init]; 32 self.motionManager.accelerometerUpdateInterval = .2; 33 self.motionManager.gyroUpdateInterval = .2; 34 // self.motionManager.accelerometerUpdateInterval = .1; 35 // self.motionManager.gyroUpdateInterval = .1; 36 37 [self.motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] 38 withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { 39 [self outputAccelertionData:accelerometerData.acceleration]; 40 if(error){ 41 NSLog(@"%@", error); 42 } 43 }]; 44 45 [self.motionManager startGyroUpdatesToQueue:[NSOperationQueue currentQueue] 46 withHandler:^(CMGyroData *gyroData, NSError *error) { 47 [self outputRotationData:gyroData.rotationRate]; 48 }]; 32 // Core Motion 33 // self.motionManager = [[CMMotionManager alloc] init]; 34 // self.motionManager.accelerometerUpdateInterval = .2; 35 // self.motionManager.gyroUpdateInterval = .2; 36 // // self.motionManager.accelerometerUpdateInterval = .1; 37 // // self.motionManager.gyroUpdateInterval = .1; 38 // 39 // [self.motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] 40 // withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { 41 // [self outputAccelertionData:accelerometerData.acceleration]; 42 // if(error){ 43 // NSLog(@"%@", error); 44 // } 45 // }]; 46 // 47 // [self.motionManager startGyroUpdatesToQueue:[NSOperationQueue currentQueue] 48 // withHandler:^(CMGyroData *gyroData, NSError *error) { 49 // [self outputRotationData:gyroData.rotationRate]; 50 // }]; 49 51 50 52 } -
iOS/Orbit/Orbit/controllers/FlightViewController.m
raf91708 rf45b70a 206 206 { 207 207 208 / / /**209 //* Score points based on target slider levels210 //* If you pass your goal with either Attention or Meditation211 //* the higher target of the two will counts as points per second.212 //*213 //* Minimum threshold for points is set as "minimumScoreTarget"214 //*215 //* For example, assume minimumScoreTarget is 40%.216 //* If your target Attention is 60% and you go past to reach 80%217 //* you will receive 20 points per second (60-40). If your218 //* target is 80% and you reach 80% you will receive 40219 //* points per second (80-40).220 //*221 //* You can set both Attention and Meditation targets at the222 //* same time. Reaching either will fly the helicopter but you223 //* will only receive points for the higher-scoring target of224 //* the two.225 //*226 //*/208 /** 209 * Score points based on target slider levels 210 * If you pass your goal with either Attention or Meditation 211 * the higher target of the two will counts as points per second. 212 * 213 * Minimum threshold for points is set as "minimumScoreTarget" 214 * 215 * For example, assume minimumScoreTarget is 40%. 216 * If your target Attention is 60% and you go past to reach 80% 217 * you will receive 20 points per second (60-40). If your 218 * target is 80% and you reach 80% you will receive 40 219 * points per second (80-40). 220 * 221 * You can set both Attention and Meditation targets at the 222 * same time. Reaching either will fly the helicopter but you 223 * will only receive points for the higher-scoring target of 224 * the two. 225 * 226 */ 227 227 228 228 int eegAttentionScore = 0; … … 275 275 [self displayScore]; 276 276 277 278 } // updateScore 279 280 281 // ################################################################ 277 } 282 278 283 279 - (void) displayScore … … 285 281 self.scoresDisplay.text = [NSString stringWithFormat:@"Scores Current: %i Last: %i High: %i", (int)scoreCurrent, (int)scoreLast, (int)scoreHigh]; 286 282 } 287 288 // ################################################################289 283 290 284 - (void) resetCurrentScore … … 295 289 scoreCurrent = 0; 296 290 297 } // resetCurrentScore291 } 298 292 299 293 @end
Note: See TracChangeset
for help on using the changeset viewer.