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
main.cpp@7:098d0077f543, 2017-11-25 (annotated)
- Committer:
- NdA994
- Date:
- Sat Nov 25 17:48:08 2017 +0000
- Revision:
- 7:098d0077f543
- Parent:
- 6:f689244d5d33
- Child:
- 9:7f0c1261e905
classe 10
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
NdA994 | 2:f59bd5312559 | 2 | #include "setting.h" |
NdA994 | 2:f59bd5312559 | 3 | #include "lettoreSD.h" |
NdA994 | 3:3b2b8b0955f9 | 4 | #include "accellerometro.h" |
NdA994 | 3:3b2b8b0955f9 | 5 | |
NdA994 | 3:3b2b8b0955f9 | 6 | DigitalIn mybutton(USER_BUTTON); |
NdA994 | 3:3b2b8b0955f9 | 7 | |
mbed_official | 0:bdbd3d6fc5d5 | 8 | int main() { |
NdA994 | 3:3b2b8b0955f9 | 9 | init(); |
NdA994 | 3:3b2b8b0955f9 | 10 | initFile(); |
NdA994 | 3:3b2b8b0955f9 | 11 | initAccellerometro(); |
NdA994 | 3:3b2b8b0955f9 | 12 | aperturaFile(); |
NdA994 | 3:3b2b8b0955f9 | 13 | /*aperturaFile(); |
NdA994 | 2:f59bd5312559 | 14 | for(int i=0; i<1000; i++){ |
NdA994 | 2:f59bd5312559 | 15 | stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); |
NdA994 | 3:3b2b8b0955f9 | 16 | } |
NdA994 | 2:f59bd5312559 | 17 | chiusuraFile(); |
NdA994 | 2:f59bd5312559 | 18 | printf("Goodbye World!\n\r"); |
NdA994 | 3:3b2b8b0955f9 | 19 | raccoltaDati();*/ |
NdA994 | 3:3b2b8b0955f9 | 20 | Timer timer; |
NdA994 | 3:3b2b8b0955f9 | 21 | while(1){ |
NdA994 | 4:58e4283f9a59 | 22 | timer.start(); |
NdA994 | 3:3b2b8b0955f9 | 23 | raccoltaDati(); |
NdA994 | 4:58e4283f9a59 | 24 | //stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); |
NdA994 | 7:098d0077f543 | 25 | fprintf(fp, "A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n"); |
NdA994 | 4:58e4283f9a59 | 26 | timer.stop(); |
NdA994 | 5:52d527a45a30 | 27 | if(timer.read_ms()>20){ |
NdA994 | 4:58e4283f9a59 | 28 | printf("tempo: %f\n\r", timer.read()); |
NdA994 | 4:58e4283f9a59 | 29 | } |
NdA994 | 4:58e4283f9a59 | 30 | else{ |
NdA994 | 5:52d527a45a30 | 31 | wait_ms(20-timer.read_ms()); |
NdA994 | 4:58e4283f9a59 | 32 | } |
NdA994 | 4:58e4283f9a59 | 33 | timer.reset(); |
NdA994 | 4:58e4283f9a59 | 34 | if (mybutton == 0) { |
NdA994 | 4:58e4283f9a59 | 35 | chiusuraFile(); |
NdA994 | 4:58e4283f9a59 | 36 | aperturaFile(); |
NdA994 | 4:58e4283f9a59 | 37 | wait(1); |
NdA994 | 4:58e4283f9a59 | 38 | } |
NdA994 | 4:58e4283f9a59 | 39 | |
NdA994 | 4:58e4283f9a59 | 40 | /*if(i%100==99){ |
NdA994 | 3:3b2b8b0955f9 | 41 | timer.stop(); |
NdA994 | 3:3b2b8b0955f9 | 42 | float tempo = 1 - timer.read(); |
NdA994 | 3:3b2b8b0955f9 | 43 | wait(tempo); |
NdA994 | 3:3b2b8b0955f9 | 44 | printf("tempo: %f\n\r", tempo + timer.read()); |
NdA994 | 3:3b2b8b0955f9 | 45 | timer.reset(); |
NdA994 | 3:3b2b8b0955f9 | 46 | timer.start(); |
NdA994 | 3:3b2b8b0955f9 | 47 | } |
NdA994 | 4:58e4283f9a59 | 48 | i++;*/ |
NdA994 | 4:58e4283f9a59 | 49 | |
NdA994 | 3:3b2b8b0955f9 | 50 | } |
mbed_official | 0:bdbd3d6fc5d5 | 51 | } |