Changeset f45b70a in orbit


Ignore:
Timestamp:
12/31/13 11:03:34 (6 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
c3d6d63
Parents:
af91708
Message:
  • Core Motion disabled for tutorial expansion
Location:
iOS/Orbit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/controllers/AdvancedViewController.h

    r16249e0 rf45b70a  
    1111 
    1212#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 
    1422 
    1523double defaultControlThrottle = 0.8; 
     
    5765- (IBAction) changeSwitchTiltSensorControlThrottle:(id)sender; 
    5866 
    59 @property (strong, nonatomic) CMMotionManager *motionManager; 
    60  
     67#ifdef __CORE_MOTION__ 
     68   @property (strong, nonatomic) CMMotionManager *motionManager; 
     69#endif 
    6170 
    6271@end 
  • iOS/Orbit/Orbit/controllers/AdvancedViewController.m

    r16249e0 rf45b70a  
    1414#import "AppDelegate.h" 
    1515 
     16 
    1617@implementation AdvancedViewController { 
    1718   SignalConverter *signalConverter; 
     
    2930   //   [alert show]; 
    3031    
    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   //                                   }]; 
    4951    
    5052} 
  • iOS/Orbit/Orbit/controllers/FlightViewController.m

    raf91708 rf45b70a  
    206206{ 
    207207    
    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    //    */ 
     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    */ 
    227227    
    228228   int eegAttentionScore = 0; 
     
    275275   [self displayScore]; 
    276276    
    277     
    278 } // updateScore 
    279  
    280  
    281 // ################################################################ 
     277} 
    282278 
    283279- (void) displayScore 
     
    285281   self.scoresDisplay.text = [NSString stringWithFormat:@"Scores        Current: %i    Last: %i    High: %i", (int)scoreCurrent, (int)scoreLast, (int)scoreHigh]; 
    286282} 
    287  
    288 // ################################################################ 
    289283 
    290284- (void) resetCurrentScore 
     
    295289   scoreCurrent = 0; 
    296290    
    297 } // resetCurrentScore 
     291} 
    298292 
    299293@end 
Note: See TracChangeset for help on using the changeset viewer.