Ignore:
Timestamp:
01/02/14 09:22:48 (8 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
fc960da
Parents:
c1a500d
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/SignalConverter.m

    r16249e0 r2246ba0  
    3131    int signalStrength, attentionLevel, meditationLevel; // the latest readings from the headset 
    3232    int yaw, throttle, pitch; 
     33     
     34    int historyAttention[30]; 
     35    int historyAttentionIndex; 
     36    int historyMeditation[30]; 
     37    int historyMeditationIndex; 
     38     
     39//    _historyAttention = [NSArray arrayWithObjects:[NSNumber numberWithFloat:6.9]]; 
     40     
     41 
     42     
    3343} 
    3444 
     
    5161        pitch = 31; 
    5262         
     63        historyAttentionIndex = 0; 
     64        historyMeditationIndex = 0; 
     65         
    5366        // initialise the audio session - this should only be done once 
    5467        AudioSessionInitialize(NULL, NULL, NULL, NULL); 
    5568        AudioSessionSetActive(YES); 
     69         
     70//        NSArray *tempFood = [[NSArray alloc] initWithArray:[self returnOtherArray]]; 
     71//        NSArray *tempFood = [[NSArray alloc] arrayWithObjects:[NSNumber numberWithFloat:6.9]]]; 
     72         
     73//        _historyAttention = tempFood; 
    5674         
    5775#if USE_AUDIO_GENERATOR 
     
    110128    [self setAttentionLevel:(NSNumber *)[data valueForKey:ATTENTION_KEY]]; 
    111129    [self setMeditationLevel:(NSNumber *)[data valueForKey:MEDITATION_KEY]]; 
     130     
     131    historyAttention[historyAttentionIndex] = attentionLevel; 
     132    historyMeditation[historyMeditationIndex] = meditationLevel; 
     133     
     134    historyAttentionIndex = historyAttentionIndex + 1; 
     135    historyMeditationIndex = historyMeditationIndex + 1; 
     136     
     137    if (historyAttentionIndex == 30) { 
     138        NSLog(@"Attention Array Full"); 
     139        historyAttentionIndex = 0; 
     140        historyMeditationIndex = 0; 
     141         
     142        for (int i=0; i<30; i++){ 
     143            NSLog(@"%d: %d", i, historyAttention[i]); 
     144        } 
     145         
     146    } 
     147     
    112148} 
    113149 
Note: See TracChangeset for help on using the changeset viewer.