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.
Diff: main.cpp
- Revision:
- 20:2d02441d1876
- Parent:
- 19:c765e311adbd
--- a/main.cpp Wed Nov 03 16:47:27 2021 +0000
+++ b/main.cpp Wed Nov 03 16:58:17 2021 +0000
@@ -7,7 +7,7 @@
#include "locale.h"
#include "time.h"
-Serial pc(USBTX, USBRX);
+Serial pc(USBTX, USBRX, 115200);
// MOSI, MISO, SCK, CS
SDFileSystem sd(D11, D12, D13, D10, "sd");// the pinout on the mbed Cool Components workshop board
FILE *fp;
@@ -24,7 +24,6 @@
/* Simple main function */
int main() {
- pc.baud(115200);
uint8_t id;
int32_t x_axes[3];
int32_t g_axes[3];
@@ -92,7 +91,7 @@
//Initialize SD CARD
char filename[64];
char date[64];
- pc.printf("Check SD\r\n");
+ printf("Check SD\r\n");
mkdir("/sd/ISK01A2", 0777);
int name = 0;
// Save name with next name test_001,test_002, ecc...
@@ -130,11 +129,11 @@
for (i=0; i<=n; i++){
fprintf(fp,"%3d,%3.3f,%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\r\n", i, time[i], acc_x[i], acc_y[i], acc_z[i], gyro_x[i], gyro_y[i], gyro_z[i]); //Save current data into file txt
- //pc.printf("%3d,%3.3f,%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\r\n", i, time[i], acc_x[i], acc_y[i], acc_z[i], gyro_x[i], gyro_y[i], gyro_z[i]);
+ //printf("%3d,%3.3f,%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\r\n", i, time[i], acc_x[i], acc_y[i], acc_z[i], gyro_x[i], gyro_y[i], gyro_z[i]);
}
t.reset();
fclose(fp);
- pc.printf("File successfully written!\r\n");
+ printf("File successfully written!\r\n");
live_writing = false;
wait(2);
}//end else
@@ -159,11 +158,11 @@
for (i=0; i<=n; i++){
fprintf(fp,"%3d,%3.3f,%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\r\n", i, time[i], acc_x[i], acc_y[i], acc_z[i], gyro_x[i], gyro_y[i], gyro_z[i]); //Save current data into file txt
- //pc.printf("%3d,%3.3f,%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\r\n", i, time[i], acc_x[i], acc_y[i], acc_z[i], gyro_x[i], gyro_y[i], gyro_z[i]);
+ //printf("%3d,%3.3f,%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\r\n", i, time[i], acc_x[i], acc_y[i], acc_z[i], gyro_x[i], gyro_y[i], gyro_z[i]);
}
t.reset();
fclose(fp);
- pc.printf("File successfully written!\r\n");
+ printf("File successfully written!\r\n");
live_writing = false;
wait(2);
}