Changeset ace9e89 in orbit
- Timestamp:
- 11/15/12 16:47:12 (10 years ago)
- Branches:
- master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
- Children:
- fae043a
- Parents:
- f460326
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arduino/puzzlebox_orbit_Uno_V3/puzzlebox_orbit_Uno_V3.ino
r8c73fb4 race9e89 107 107 } 108 108 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 109 147 void loop() 110 148 {int i; … … 125 163 case '2': _channel='B'; Serial.println("_channel=B"); break; 126 164 case '3': _channel='C'; Serial.println("_channel=C"); break; 165 case 'x': setThrottle(); break; 127 166 } 128 167 }
Note: See TracChangeset
for help on using the changeset viewer.