E=MC / Mbed 2 deprecated coolcarsuperfast2

Dependencies:   mbed MODSERIAL telemetry-master

Fork of coolcarsuperfast by Michael Romain

Committer:
cheryl_he
Date:
Tue Apr 28 18:22:14 2015 +0000
Revision:
22:21ec3ac3b8ea
Parent:
19:d9746cc2ec80
bluetooth pin

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mawk2311 0:ad375c052b4c 1 #include "mbed.h"
mawk2311 0:ad375c052b4c 2 #include "stdlib.h"
ericoneill 7:6d5ddcf12cf3 3 #include <vector>
mawk2311 0:ad375c052b4c 4 //Outputs
mawk2311 0:ad375c052b4c 5 DigitalOut led1(LED1);
mawk2311 0:ad375c052b4c 6 DigitalOut clk(PTD5);
mawk2311 0:ad375c052b4c 7 DigitalOut si(PTD4);
mawk2311 5:20223464f7aa 8 PwmOut motor1(PTA12);
mawk2311 5:20223464f7aa 9 PwmOut motor2(PTA4);
mawk2311 5:20223464f7aa 10 DigitalOut break1(PTC7);
mawk2311 5:20223464f7aa 11 DigitalOut break2(PTC0);
mawk2311 0:ad375c052b4c 12 PwmOut servo(PTA5);
mawk2311 0:ad375c052b4c 13
mawk2311 5:20223464f7aa 14 Serial pc(USBTX, USBRX); // tx, rx
cheryl_he 22:21ec3ac3b8ea 15 Serial bt(PTA2, PTA1); // tx, rx for bluetooth
mawk2311 5:20223464f7aa 16
mawk2311 0:ad375c052b4c 17 //Inputs
mawk2311 0:ad375c052b4c 18 AnalogIn camData(PTC2);
cheryl_he 22:21ec3ac3b8ea 19 //AnalogIn camData2(PTB3);
mawk2311 0:ad375c052b4c 20
mawk2311 0:ad375c052b4c 21 //Encoder setup and variables
mawk2311 0:ad375c052b4c 22 InterruptIn interrupt(PTA13);
mawk2311 0:ad375c052b4c 23
mawk2311 0:ad375c052b4c 24 //Line Tracking Variables --------------------------------
mawk2311 0:ad375c052b4c 25 float ADCdata [128];
mawk2311 5:20223464f7aa 26 float maxAccum;
mawk2311 5:20223464f7aa 27 float maxCount;
mawk2311 0:ad375c052b4c 28 float approxPos;
mawk2311 12:48b76450c4b4 29 float prevApproxPos;
mawk2311 15:55e9fffc653a 30 int trackWindow = 30;
mawk2311 14:888495814f3c 31 int startWindow;
mawk2311 14:888495814f3c 32 int endWindow;
mawk2311 5:20223464f7aa 33 float maxVal;
mawk2311 5:20223464f7aa 34 int maxLoc;
mawk2311 12:48b76450c4b4 35
mawk2311 12:48b76450c4b4 36 bool firstTime;
mawk2311 11:b59ec039a712 37
mawk2311 10:e40ad924e935 38 //Data Collection
mawk2311 10:e40ad924e935 39 bool dataCol = false;
mawk2311 11:b59ec039a712 40 int loopCounterForModdingSoThatWeCanIncreaseTheRecordingTime;
mawk2311 10:e40ad924e935 41
mawk2311 5:20223464f7aa 42 //Line Crossing variables
mawk2311 5:20223464f7aa 43 int prevTrackLoc;
mawk2311 18:7941524e0d28 44 int spaceThresh = 3;
mawk2311 18:7941524e0d28 45 int widthThresh = 10;
mawk2311 5:20223464f7aa 46 bool space;
mawk2311 0:ad375c052b4c 47
mawk2311 0:ad375c052b4c 48 //Servo turning parameters
mawk2311 0:ad375c052b4c 49 float straight = 0.00155f;
mawk2311 16:79106efd7a57 50 float hardLeft = 0.0012f;
mawk2311 16:79106efd7a57 51 float hardRight = 0.0020f;
mawk2311 12:48b76450c4b4 52 //float hardLeft = 0.0010f;
mawk2311 12:48b76450c4b4 53 //float hardRight = 0.00195f;
mawk2311 0:ad375c052b4c 54
mawk2311 5:20223464f7aa 55 //Servo Directions
mawk2311 5:20223464f7aa 56 float currDir;
mawk2311 5:20223464f7aa 57 float prevDir;
mawk2311 5:20223464f7aa 58
ericoneill 7:6d5ddcf12cf3 59 // All linescan data for the period the car is running on. To be printed after a set amount of time
ericoneill 7:6d5ddcf12cf3 60 //std::vector<std::vector<int> > frames;
ericoneill 7:6d5ddcf12cf3 61 const int numData = 1000;
ericoneill 7:6d5ddcf12cf3 62 int lineCenters [numData] = {0};
ericoneill 7:6d5ddcf12cf3 63 int times [numData] = {0};
ericoneill 7:6d5ddcf12cf3 64 int loopCtr = 0;
ericoneill 7:6d5ddcf12cf3 65
mawk2311 0:ad375c052b4c 66 //End of Line Tracking Variables -------------------------
mawk2311 0:ad375c052b4c 67
mawk2311 0:ad375c052b4c 68 //Encoder and Motor Driver Variables ---------------------
mawk2311 0:ad375c052b4c 69
mawk2311 0:ad375c052b4c 70 //Intervals used during encoder data collection to measure velocity
mawk2311 0:ad375c052b4c 71 int interval1=0;
mawk2311 0:ad375c052b4c 72 int interval2=0;
mawk2311 0:ad375c052b4c 73 int interval3=0;
mawk2311 0:ad375c052b4c 74 int avg_interval=0;
mawk2311 0:ad375c052b4c 75 int lastchange1 = 0;
mawk2311 0:ad375c052b4c 76 int lastchange2 = 0;
mawk2311 0:ad375c052b4c 77 int lastchange3 = 0;
mawk2311 0:ad375c052b4c 78 int lastchange4 = 0;
mawk2311 0:ad375c052b4c 79
mawk2311 0:ad375c052b4c 80 //Variables used to for velocity control
mawk2311 0:ad375c052b4c 81 float avg_speed = 0;
mawk2311 5:20223464f7aa 82 float last_speed = 0;
mawk2311 5:20223464f7aa 83
mawk2311 0:ad375c052b4c 84 float stall_check = 0;
mawk2311 0:ad375c052b4c 85 float tuning_val = 1;
mawk2311 0:ad375c052b4c 86
mawk2311 6:f1d948d2d6c1 87 int numInterrupts = 0;
mawk2311 5:20223464f7aa 88
mawk2311 19:d9746cc2ec80 89 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Tuning Values that can make it or break it ~~~~~~~~~~~~~~~~~~~~~~~~
mawk2311 19:d9746cc2ec80 90 float pulsewidth = 0.14f;
mawk2311 19:d9746cc2ec80 91 int intTimMod = 0;
mawk2311 19:d9746cc2ec80 92 int maxValThresh = .1; //~.1 for earlier in the day, reduce it (maybe something like .05 - .01 or something) as it gets darker
mawk2311 19:d9746cc2ec80 93 bool turnSpeedControl = false; //have increased PWMs when turning when true.
mawk2311 14:888495814f3c 94 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mawk2311 16:79106efd7a57 95
mawk2311 5:20223464f7aa 96 // Hardware periods
mawk2311 5:20223464f7aa 97 float motorPeriod = .0025;
mawk2311 5:20223464f7aa 98 float servoPeriod = .0025;
mawk2311 5:20223464f7aa 99
mawk2311 0:ad375c052b4c 100 Timer t;
mawk2311 0:ad375c052b4c 101 Timer servoTimer;
ericoneill 7:6d5ddcf12cf3 102 Timer printTimer; //after printTimer reaches a certain value the main loop will terminate and print the frames
mawk2311 0:ad375c052b4c 103
mawk2311 0:ad375c052b4c 104 //End of Encoder and Motor Driver Variables ----------------------
mawk2311 0:ad375c052b4c 105
mawk2311 6:f1d948d2d6c1 106 //Function for speeding up KL25Z ADC
mawk2311 6:f1d948d2d6c1 107 void initADC(void){
mawk2311 6:f1d948d2d6c1 108
mawk2311 6:f1d948d2d6c1 109 ADC0->CFG1 = ADC0->CFG1 & (
mawk2311 6:f1d948d2d6c1 110 ~(
mawk2311 6:f1d948d2d6c1 111 0x80 // LDLPC = 0 ; no low-power mode
mawk2311 6:f1d948d2d6c1 112 | 0x60 // ADIV = 1
mawk2311 6:f1d948d2d6c1 113 | 0x10 // Sample time short
mawk2311 6:f1d948d2d6c1 114 | 0x03 // input clock = BUS CLK
mawk2311 6:f1d948d2d6c1 115 )
mawk2311 6:f1d948d2d6c1 116 ) ; // clkdiv <= 1
mawk2311 6:f1d948d2d6c1 117 ADC0->CFG2 = ADC0->CFG2
mawk2311 6:f1d948d2d6c1 118 | 0x03 ; // Logsample Time 11 = 2 extra ADCK
mawk2311 6:f1d948d2d6c1 119 ADC0->SC3 = ADC0->SC3
mawk2311 6:f1d948d2d6c1 120 & (~(0x03)) ; // hardware avarage off
mawk2311 6:f1d948d2d6c1 121 }
mawk2311 6:f1d948d2d6c1 122
mawk2311 0:ad375c052b4c 123 int main() {
mawk2311 6:f1d948d2d6c1 124
mawk2311 6:f1d948d2d6c1 125 //Alter reg values to speed up KL25Z
mawk2311 6:f1d948d2d6c1 126 initADC();
mawk2311 6:f1d948d2d6c1 127
mawk2311 0:ad375c052b4c 128 //Line Tracker Initializations
mawk2311 0:ad375c052b4c 129 int integrationCounter = 0;
mawk2311 0:ad375c052b4c 130
mawk2311 6:f1d948d2d6c1 131 //Initial values for directions
mawk2311 5:20223464f7aa 132 currDir = 0;
mawk2311 5:20223464f7aa 133 prevDir = 0;
mawk2311 5:20223464f7aa 134
mawk2311 0:ad375c052b4c 135 // Motor Driver Initializations
mawk2311 5:20223464f7aa 136 motor1.period(motorPeriod);
mawk2311 5:20223464f7aa 137 motor2.period(motorPeriod);
mawk2311 0:ad375c052b4c 138
mawk2311 5:20223464f7aa 139 // Servo Initialization
mawk2311 5:20223464f7aa 140 servo.period(servoPeriod);
mawk2311 15:55e9fffc653a 141 servo.pulsewidth(hardRight);
mawk2311 5:20223464f7aa 142 wait(3);
mawk2311 0:ad375c052b4c 143
mawk2311 12:48b76450c4b4 144 motor1.pulsewidth(motorPeriod*pulsewidth);
mawk2311 12:48b76450c4b4 145 motor2.pulsewidth(motorPeriod*pulsewidth);
mawk2311 0:ad375c052b4c 146 break1 = 0;
mawk2311 0:ad375c052b4c 147 break2 = 0;
mawk2311 0:ad375c052b4c 148
mawk2311 12:48b76450c4b4 149 firstTime = true;
mawk2311 12:48b76450c4b4 150
mawk2311 10:e40ad924e935 151 //t.start();
mawk2311 10:e40ad924e935 152
mawk2311 10:e40ad924e935 153 if(dataCol){
mawk2311 11:b59ec039a712 154 loopCounterForModdingSoThatWeCanIncreaseTheRecordingTime = 0;
mawk2311 10:e40ad924e935 155 printTimer.start();
mawk2311 10:e40ad924e935 156 }
ericoneill 8:e126c900c89d 157
mawk2311 0:ad375c052b4c 158 while(1) {
mawk2311 10:e40ad924e935 159 if(dataCol){
mawk2311 10:e40ad924e935 160 //break out of main loop if enough time has passed;
mawk2311 10:e40ad924e935 161 if(loopCtr >= numData && dataCol){
mawk2311 10:e40ad924e935 162 break;
mawk2311 10:e40ad924e935 163 }
ericoneill 7:6d5ddcf12cf3 164 }
mawk2311 0:ad375c052b4c 165 if(integrationCounter % 151== 0){
mawk2311 10:e40ad924e935 166 /*
mawk2311 0:ad375c052b4c 167 //Disable interrupts
mawk2311 5:20223464f7aa 168 interrupt.fall(NULL);
mawk2311 5:20223464f7aa 169 interrupt.rise(NULL);
ericoneill 7:6d5ddcf12cf3 170 */
mawk2311 10:e40ad924e935 171
mawk2311 0:ad375c052b4c 172 //Send start of integration signal
mawk2311 0:ad375c052b4c 173 si = 1;
mawk2311 0:ad375c052b4c 174 clk = 1;
mawk2311 0:ad375c052b4c 175
mawk2311 0:ad375c052b4c 176 si = 0;
mawk2311 0:ad375c052b4c 177 clk = 0;
mawk2311 0:ad375c052b4c 178
mawk2311 0:ad375c052b4c 179 //Reset timing counter for integration
mawk2311 0:ad375c052b4c 180 integrationCounter = 0;
mawk2311 0:ad375c052b4c 181
mawk2311 0:ad375c052b4c 182 //Reset line tracking variables
mawk2311 5:20223464f7aa 183 maxAccum = 0;
mawk2311 5:20223464f7aa 184 maxCount = 0;
mawk2311 0:ad375c052b4c 185 approxPos = 0;
mawk2311 0:ad375c052b4c 186
mawk2311 5:20223464f7aa 187 space = false;
mawk2311 6:f1d948d2d6c1 188
mawk2311 0:ad375c052b4c 189 }
mawk2311 0:ad375c052b4c 190 else if (integrationCounter > 129){
mawk2311 5:20223464f7aa 191 //Start Timer
mawk2311 6:f1d948d2d6c1 192 //t.start();
mawk2311 0:ad375c052b4c 193
mawk2311 5:20223464f7aa 194 //Enable interrupts
mawk2311 6:f1d948d2d6c1 195 //interrupt.fall(&fallInterrupt);
mawk2311 6:f1d948d2d6c1 196 //interrupt.rise(&riseInterrupt);
mawk2311 5:20223464f7aa 197
mawk2311 12:48b76450c4b4 198 if (firstTime){
mawk2311 12:48b76450c4b4 199
mawk2311 12:48b76450c4b4 200 maxVal = ADCdata[10];
mawk2311 12:48b76450c4b4 201 for (int c = 11; c < 118; c++) {
mawk2311 12:48b76450c4b4 202 if (ADCdata[c] > maxVal){
mawk2311 12:48b76450c4b4 203 maxVal = ADCdata[c];
mawk2311 12:48b76450c4b4 204 maxLoc = c;
mawk2311 12:48b76450c4b4 205 }
mawk2311 0:ad375c052b4c 206 }
mawk2311 12:48b76450c4b4 207
mawk2311 12:48b76450c4b4 208 for (int c = 10; c < 118; c++) {
mawk2311 19:d9746cc2ec80 209 if (ADCdata[c] <= maxVal && maxVal - ADCdata[c] < maxValThresh){
mawk2311 12:48b76450c4b4 210 maxAccum += c;
mawk2311 12:48b76450c4b4 211 maxCount++;
mawk2311 15:55e9fffc653a 212 if (c > prevTrackLoc + spaceThresh || maxCount > widthThresh){
mawk2311 12:48b76450c4b4 213 space = true;
mawk2311 12:48b76450c4b4 214 }
mawk2311 12:48b76450c4b4 215 prevTrackLoc = c;
mawk2311 12:48b76450c4b4 216 }
mawk2311 12:48b76450c4b4 217 }
mawk2311 12:48b76450c4b4 218
mawk2311 16:79106efd7a57 219 //firstTime = false;
mawk2311 12:48b76450c4b4 220 } else {
mawk2311 12:48b76450c4b4 221
mawk2311 14:888495814f3c 222 startWindow = prevApproxPos - trackWindow;
mawk2311 14:888495814f3c 223 endWindow = prevApproxPos + trackWindow;
mawk2311 14:888495814f3c 224 if (startWindow < 0){
mawk2311 14:888495814f3c 225 startWindow = 0;
mawk2311 14:888495814f3c 226 }
mawk2311 14:888495814f3c 227 if (endWindow > 118){
mawk2311 14:888495814f3c 228 endWindow = 118;
mawk2311 14:888495814f3c 229 }
mawk2311 12:48b76450c4b4 230 maxVal = ADCdata[10];
mawk2311 14:888495814f3c 231 for (int c = startWindow; c < endWindow; c++) {
mawk2311 12:48b76450c4b4 232 if (ADCdata[c] > maxVal){
mawk2311 12:48b76450c4b4 233 maxVal = ADCdata[c];
mawk2311 12:48b76450c4b4 234 maxLoc = c;
mawk2311 12:48b76450c4b4 235 }
mawk2311 12:48b76450c4b4 236 }
mawk2311 12:48b76450c4b4 237
mawk2311 14:888495814f3c 238 for (int c = startWindow; c < endWindow; c++) {
mawk2311 19:d9746cc2ec80 239 if (ADCdata[c] <= maxVal && maxVal - ADCdata[c] < maxValThresh){
mawk2311 11:b59ec039a712 240 maxAccum += c;
mawk2311 11:b59ec039a712 241 maxCount++;
mawk2311 15:55e9fffc653a 242 if (c > prevTrackLoc + spaceThresh || maxCount > widthThresh){
mawk2311 11:b59ec039a712 243 space = true;
mawk2311 11:b59ec039a712 244 }
mawk2311 11:b59ec039a712 245 prevTrackLoc = c;
mawk2311 5:20223464f7aa 246 }
mawk2311 12:48b76450c4b4 247 }
mawk2311 11:b59ec039a712 248 }
mawk2311 12:48b76450c4b4 249 /*
mawk2311 11:b59ec039a712 250 //Check if we need to alter integration time due to brightness
mawk2311 11:b59ec039a712 251 if (maxVal < 0.15f){
mawk2311 11:b59ec039a712 252 intTimMod += 10;
mawk2311 11:b59ec039a712 253 } else if (maxVal >= 1) {
mawk2311 11:b59ec039a712 254 if (intTimMod > 0) {
mawk2311 11:b59ec039a712 255 intTimMod -= 10;
mawk2311 0:ad375c052b4c 256 }
mawk2311 0:ad375c052b4c 257 }
mawk2311 12:48b76450c4b4 258 */
mawk2311 11:b59ec039a712 259
mawk2311 6:f1d948d2d6c1 260 //Line Crossing Checks
mawk2311 10:e40ad924e935 261 if (space) {
mawk2311 5:20223464f7aa 262 currDir = prevDir;
mawk2311 15:55e9fffc653a 263 firstTime = true;
mawk2311 5:20223464f7aa 264 } else {
mawk2311 15:55e9fffc653a 265 approxPos = (float)maxAccum/(float)maxCount;
ericoneill 8:e126c900c89d 266
mawk2311 10:e40ad924e935 267 if(dataCol){
mawk2311 10:e40ad924e935 268 if(loopCounterForModdingSoThatWeCanIncreaseTheRecordingTime%3==0){
mawk2311 10:e40ad924e935 269 lineCenters[loopCtr] = approxPos;
mawk2311 10:e40ad924e935 270 times[loopCtr] = printTimer.read_ms();
mawk2311 10:e40ad924e935 271 loopCtr++;
mawk2311 10:e40ad924e935 272 }
ericoneill 9:ad08181ad1cc 273 }
mawk2311 10:e40ad924e935 274
mawk2311 16:79106efd7a57 275 currDir = hardLeft + (approxPos)/((float) 118)*(hardRight-hardLeft);
mawk2311 12:48b76450c4b4 276 prevApproxPos = approxPos;
ericoneill 9:ad08181ad1cc 277
mawk2311 5:20223464f7aa 278 }
mawk2311 16:79106efd7a57 279
mawk2311 16:79106efd7a57 280 if (turnSpeedControl){
mawk2311 16:79106efd7a57 281 //Change speed when turning at different angles
mawk2311 16:79106efd7a57 282 if(approxPos > 0 && approxPos <= 45){
mawk2311 19:d9746cc2ec80 283 motor1.pulsewidth(motorPeriod*(pulsewidth*2.0f));
mawk2311 19:d9746cc2ec80 284 motor2.pulsewidth(motorPeriod*(pulsewidth*2.0f));
mawk2311 19:d9746cc2ec80 285 } else if (approxPos > 45 && approxPos <= 55){
mawk2311 19:d9746cc2ec80 286 motor1.pulsewidth(motorPeriod*pulsewidth*1.5f);
mawk2311 19:d9746cc2ec80 287 motor2.pulsewidth(motorPeriod*pulsewidth*1.5f);
mawk2311 19:d9746cc2ec80 288 } else if (approxPos > 55 && approxPos <= 85){
mawk2311 16:79106efd7a57 289 motor1.pulsewidth(motorPeriod*pulsewidth);
mawk2311 16:79106efd7a57 290 motor2.pulsewidth(motorPeriod*pulsewidth);
mawk2311 19:d9746cc2ec80 291 } else if (approxPos > 85 && approxPos <= 95){
mawk2311 19:d9746cc2ec80 292 motor1.pulsewidth(motorPeriod*pulsewidth*1.5f);
mawk2311 19:d9746cc2ec80 293 motor2.pulsewidth(motorPeriod*pulsewidth*1.5f);
mawk2311 16:79106efd7a57 294 } else {
mawk2311 19:d9746cc2ec80 295 motor1.pulsewidth(motorPeriod*(pulsewidth*2.0f));
mawk2311 19:d9746cc2ec80 296 motor2.pulsewidth(motorPeriod*(pulsewidth*2.0f));
mawk2311 16:79106efd7a57 297 }
mawk2311 16:79106efd7a57 298 }
mawk2311 16:79106efd7a57 299
mawk2311 5:20223464f7aa 300 servo.pulsewidth(currDir);
mawk2311 5:20223464f7aa 301
mawk2311 6:f1d948d2d6c1 302 //Start Velocity control after requisite number of encoder signals have been collected
mawk2311 6:f1d948d2d6c1 303 //if(numInterrupts >= 4){
mawk2311 6:f1d948d2d6c1 304 //velocity_control(0.1f, TUNING_CONSTANT_10);
mawk2311 6:f1d948d2d6c1 305 //}
mawk2311 4:09c68df71785 306
mawk2311 6:f1d948d2d6c1 307 //Save current direction as previous direction
mawk2311 5:20223464f7aa 308 prevDir = currDir;
mawk2311 0:ad375c052b4c 309
mawk2311 6:f1d948d2d6c1 310 //Prepare to start collecting more data
mawk2311 0:ad375c052b4c 311 integrationCounter = 150;
mawk2311 6:f1d948d2d6c1 312
mawk2311 6:f1d948d2d6c1 313 //Disable interrupts
mawk2311 6:f1d948d2d6c1 314 //interrupt.fall(NULL);
mawk2311 6:f1d948d2d6c1 315 //interrupt.rise(NULL);
mawk2311 6:f1d948d2d6c1 316
mawk2311 6:f1d948d2d6c1 317 //Stop timer
mawk2311 6:f1d948d2d6c1 318 //t.stop();
mawk2311 0:ad375c052b4c 319 }
mawk2311 0:ad375c052b4c 320 else{
mawk2311 0:ad375c052b4c 321 clk = 1;
mawk2311 14:888495814f3c 322 wait_us(intTimMod);
mawk2311 3:e867c4e984df 323 ADCdata[integrationCounter - 1] = camData;
mawk2311 0:ad375c052b4c 324 clk = 0;
mawk2311 0:ad375c052b4c 325 }
mawk2311 0:ad375c052b4c 326
mawk2311 0:ad375c052b4c 327 //clk = 0;
mawk2311 0:ad375c052b4c 328 integrationCounter++;
mawk2311 10:e40ad924e935 329 if(dataCol){
mawk2311 10:e40ad924e935 330 loopCounterForModdingSoThatWeCanIncreaseTheRecordingTime++;
mawk2311 10:e40ad924e935 331 }
mawk2311 0:ad375c052b4c 332 //camData.
mawk2311 0:ad375c052b4c 333
mawk2311 0:ad375c052b4c 334 }
mawk2311 10:e40ad924e935 335 if (dataCol){
mawk2311 10:e40ad924e935 336 //print frame data
mawk2311 10:e40ad924e935 337 pc.printf("printing frame data\n\r");
mawk2311 10:e40ad924e935 338 //int frameSize = frames.size();
mawk2311 10:e40ad924e935 339 //pc.printf("%i",frameSize);
mawk2311 10:e40ad924e935 340 pc.printf("[");
mawk2311 10:e40ad924e935 341 for(int i=0; i<numData; i++){
mawk2311 10:e40ad924e935 342 if(lineCenters > 0){
mawk2311 10:e40ad924e935 343 pc.printf("%i %i,",lineCenters[i], times[i]);
mawk2311 10:e40ad924e935 344 }
ericoneill 7:6d5ddcf12cf3 345 }
mawk2311 10:e40ad924e935 346 pc.printf("]\n\r");
ericoneill 7:6d5ddcf12cf3 347 }
mawk2311 0:ad375c052b4c 348 }
ericoneill 9:ad08181ad1cc 349