Unina_corse / Mbed 2 deprecated f4_def_v2_5

Dependencies:   SDFileSystem_conMOD mbed

Fork of f4_def_v2_def by Unina_corse

Committer:
NdA994
Date:
Wed Nov 22 02:41:36 2017 +0000
Revision:
3:3b2b8b0955f9
Parent:
2:f59bd5312559
Child:
4:58e4283f9a59
Versione definitiva della scheda f4

Who changed what in which revision?

UserRevisionLine numberNew 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 int i=0;
NdA994 3:3b2b8b0955f9 22 timer.start();
NdA994 3:3b2b8b0955f9 23 while(1){
NdA994 3:3b2b8b0955f9 24 raccoltaDati();
NdA994 3:3b2b8b0955f9 25 stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n");
NdA994 3:3b2b8b0955f9 26 if(i%100==99){
NdA994 3:3b2b8b0955f9 27 timer.stop();
NdA994 3:3b2b8b0955f9 28 float tempo = 1 - timer.read();
NdA994 3:3b2b8b0955f9 29 wait(tempo);
NdA994 3:3b2b8b0955f9 30 printf("tempo: %f\n\r", tempo + timer.read());
NdA994 3:3b2b8b0955f9 31 timer.reset();
NdA994 3:3b2b8b0955f9 32 timer.start();
NdA994 3:3b2b8b0955f9 33 }
NdA994 3:3b2b8b0955f9 34 i++;
NdA994 3:3b2b8b0955f9 35 if (mybutton == 0) {
NdA994 3:3b2b8b0955f9 36 chiusuraFile();
NdA994 3:3b2b8b0955f9 37 aperturaFile();
NdA994 3:3b2b8b0955f9 38 wait(0.5);
NdA994 3:3b2b8b0955f9 39 }
NdA994 3:3b2b8b0955f9 40 }
mbed_official 0:bdbd3d6fc5d5 41 }