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: SDFileSystem_conMOD mbed-rtos mbed
Fork of f4_sd_imu_4 by
Diff: main.cpp
- Revision:
- 9:7f0c1261e905
- Parent:
- 7:098d0077f543
- Child:
- 11:3b5e035ffef9
--- a/main.cpp Sat Nov 25 17:49:55 2017 +0000 +++ b/main.cpp Wed Dec 13 21:06:23 2017 +0000 @@ -10,30 +10,32 @@ initFile(); initAccellerometro(); aperturaFile(); - /*aperturaFile(); - for(int i=0; i<1000; i++){ - stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); - } - chiusuraFile(); - printf("Goodbye World!\n\r"); - raccoltaDati();*/ + Timer timer; - while(1){ + + while(1){ + timer.start(); raccoltaDati(); //stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); - fprintf(fp, "A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); + //fprintf(fp, "A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); timer.stop(); - if(timer.read_ms()>20){ - printf("tempo: %f\n\r", timer.read()); + if(timer.read_ms()>10){ + int overTime = (timer.read_ms() / 10) + 1; + pc.printf("tempo: %d e overtime %d\n\r ", timer.read_ms(), overTime); + for (int i=0; i<overTime; i++){ + fprintf(fp,"#\n\r"); + } } else{ - wait_ms(20-timer.read_ms()); + wait_ms(10-timer.read_ms()); + //printf("tempo: %f\n\r", timer.read()); } timer.reset(); if (mybutton == 0) { - chiusuraFile(); - aperturaFile(); + //chiusuraFile(); + //aperturaFile(); + fprintf(fp, "###########FLAG MARCATORE PRESSIONE PULSANTE############\r\n"); wait(1); } @@ -46,6 +48,5 @@ timer.start(); } i++;*/ - } }