![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
Diff: Calculate.cpp
- Revision:
- 59:2cbbd6fea55b
- Parent:
- 58:c729d48cbeef
- Child:
- 60:27404fc0dc71
diff -r c729d48cbeef -r 2cbbd6fea55b Calculate.cpp --- a/Calculate.cpp Wed Jul 29 14:10:31 2015 +0000 +++ b/Calculate.cpp Wed Jul 29 15:27:15 2015 +0000 @@ -26,7 +26,7 @@ int calculate(double distance, int NoOfPins) { - pc.printf("new program \n"); //alert user of initialisation + //pc.printf("new program \n"); //alert user of initialisation int i = 0; while( i < NoOfPins) @@ -35,7 +35,7 @@ { if(sensor[i + 1]) { - printf("it skipped sensor % d", i); + //printf("it skipped sensor % d", i); i++; } //error checking incase next one is done @@ -44,17 +44,17 @@ timeDiff = t.read(); //reads what the timer is currently at t.reset(); //starts the timer again from 0. times[i] = timeDiff; //adds sensor times to array for logging. - pc.printf(" timediff: %lf s \t", timeDiff); + // pc.printf(" timediff: %lf s \t", timeDiff); if ( i > 0) { //to ensure it is not the first one speed = distance / timeDiff; - pc.printf(" speed : %f m/s ", speed); + pc.printf(" speed : %f m/s \n", speed); speeds[i] = speed; } i++; } pc.printf(" \n Calculate completed \n"); //alert to let user know it completed - printArray(speeds, times, NoOfPins); + // printArray(speeds, times, NoOfPins); }