Changeset f460326 in orbit


Ignore:
Timestamp:
11/15/12 16:37:41 (8 years ago)
Author:
AzureViolin <zhanghaotz@…>
Branches:
master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
Children:
ace9e89
Parents:
8c73fb4 (diff), 8e852bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Uno V3 fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arduino/puzzlebox_orbit_Uno_V3/puzzlebox_orbit_Uno_V3.ino

    r8e852bb r8c73fb4  
    107107} 
    108108 
    109 void setThrottle() { 
    110    
    111   char inByte=0; 
    112   int a=0; 
    113   int b=0; 
    114   int c=0; 
    115   int newThrottle=0; 
    116    
    117   while (Serial.available() == 0); 
    118   inByte = Serial.read() - '0'; 
    119   //Serial.println(inByte); 
    120   a = inByte; 
    121    
    122   while (Serial.available() == 0); 
    123   inByte = Serial.read() - '0'; 
    124   //Serial.println(inByte); 
    125   b = inByte; 
    126    
    127   while (Serial.available() == 0); 
    128   inByte = Serial.read() - '0'; 
    129   //Serial.println(inByte); 
    130   c = inByte; 
    131    
    132   newThrottle = (a * 100) + (b * 10) + c; 
    133    
    134   if (newThrottle < 0) 
    135     newThrottle=0; 
    136    
    137   if (newThrottle > 100) 
    138     newThrottle=100; 
    139      
    140   _throttle=newThrottle; 
    141    
    142   Serial.print("_throttle="); 
    143   Serial.println(int(_throttle)); 
    144    
    145 } 
    146  
    147109void loop() 
    148110{int i; 
     
    163125      case '2':  _channel='B';  Serial.println("_channel=B"); break; 
    164126      case '3':  _channel='C';  Serial.println("_channel=C"); break; 
    165       case '1':  _channel='A';  Serial.print("_channel=A"); break; 
    166       case '2':  _channel='B';  Serial.print("_throttle=B"); break; 
    167       case '3':  _channel='C';  Serial.print("_throttle=C"); break; 
    168       case 'x':  setThrottle(); break; 
    169127    } 
    170128  } 
Note: See TracChangeset for help on using the changeset viewer.