Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MODSERIAL SDFileSystemSeth mbed
Fork of Opstellingbachelor_opdracht by
Diff: main.cpp
- Revision:
- 2:5c856ceaea2e
- Parent:
- 1:8b45b3ad350a
- Child:
- 3:b525b7a56553
--- a/main.cpp Sun Sep 04 18:45:07 2016 +0000 +++ b/main.cpp Sun Sep 04 18:47:55 2016 +0000 @@ -92,13 +92,6 @@ } CS_1 = 1; - - // capture torque sensor data - fcs_read = fcs.read(); - - // output data to file - fprintf(fp, "%.3f\t", fcs_read); - for (int j = 0; j <= 11; j++) { if (b[j] & 0x1) { @@ -161,7 +154,7 @@ case 's': start = !start; if (start) { - led_control(led_off,led_on,led_off); //green LED during calibration + led_control(led_off,led_on,led_off); //green LED during measurement sprintf(filename_torque, "/sd/trial%d.txt", trial_numb); //construct new textfile to store data from torque sensor fp = fopen(filename_torque, "w"); if(fp == NULL) { @@ -169,8 +162,10 @@ } else { pc.printf("Measurement started... \n\r"); pc.printf("Press 's' to stop measurement\n\r"); - while(1) { - readTC(b); + while(1) { + fcs_read = fcs.read(); // capture torque sensor data + fprintf(fp, "%.3f\t", fcs_read); // output data to file + readTC(b); // call function to read thermocouple data } break; }