![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
ADC logging with demo drive board for calibration
Dependencies: mbed MODSERIAL FastPWM ADS8568_ADC
Diff: main.cpp
- Revision:
- 14:d764e256ac6d
- Parent:
- 13:0ec8fa0a0429
- Child:
- 15:a08527d78ffa
diff -r 0ec8fa0a0429 -r d764e256ac6d main.cpp --- a/main.cpp Fri Jun 28 09:57:13 2019 +0000 +++ b/main.cpp Mon Aug 05 17:19:21 2019 +0000 @@ -91,7 +91,6 @@ drive = 0; pc.baud(115200); - pc.printf("Test start\r\n"); //Reset ADC sequence reset = 1; @@ -113,9 +112,8 @@ pc.printf("%s", outString); fprintf(fp, outString); + timer.start(); for (int iStep=0; iStep<N_STEPS; iStep++) { - eTime = timer.read_ms(); - // trigger measurement drive = 1; yLED = 1; @@ -139,13 +137,13 @@ r1_sum2 = r1_sum2 + (r1*r1); r2_sum = r2_sum + r2; r2_sum2 = r2_sum2 + (r2*r2); - + + eTime = timer.read_ms(); //printf(outString, "%10d,%10d,%10f,%10f\n", iStep, eTime, r1, r2); // log data - sprintf(outString, "%5d, %10d, %5d, %5d, %5d, %5d, %f %5d, %5d, %5d, %5d, %f\n", iStep, eTime, val_array[0], val_array[1], val_array[4], val_array[5], r1, val_array[2], val_array[1], val_array[6], val_array[7], r2); + sprintf(outString, "%5d, %10d, %5d, %5d, %5d, %5d, %f, %5d, %5d, %5d, %5d, %f\n", iStep, eTime, val_array[0], val_array[1], val_array[4], val_array[5], r1, val_array[2], val_array[1], val_array[6], val_array[7], r2); pc.printf("%s", outString); fprintf(fp, outString); wait_ms(LOG_INTERVAL); - iStep++; } //r1_mean = r1_sum/n_samples;