x

Dependencies:   GYRO_DISCO_L476VG BSP_DISCO_L476VG COMPASS_DISCO_L476VG

Revision:
8:b0b8c9ed333e
Parent:
7:763b230d3b66
--- a/main.cpp	Sat Feb 27 06:55:41 2021 +0000
+++ b/main.cpp	Tue May 17 15:54:02 2022 +0000
@@ -10,7 +10,7 @@
 //
 GYRO_DISCO_L476VG gyro;
 COMPASS_DISCO_L476VG compass;
-Serial pc(SERIAL_TX, SERIAL_RX,115200);
+UnbufferedSerial pc(USBTX,USBRX,115200);
 Ticker ticker;
 DigitalOut led1(LED1);
 volatile bool flag=0;
@@ -71,8 +71,8 @@
     double AccF[2];
     double Gyr[2];
     double GyrF[2];
-    wait(1);
-    pc.printf("Super Inclinometre \n");
+    wait_us(1000000);
+ //   pc.printf("Super Inclinometre \n");
     coef_filtre_PB(1,FC,TE,coef_acc);   // H0 f0 Te
     coef_filtre_PB(1/(2*3.1415926*FC),FC,TE,coef_gyr);   // H0 f0 Te
     //pc.printf("a= %f   b=%f \n\r",coef_acc[0],coef_acc[1]);
@@ -97,7 +97,9 @@
                 led1 = !led1;
                 // angle accelero, angne gyro, angle acc. filtré, gyro filtré, angle fusion
                 //pc.printf("$%f %f %f %f %f;\n",psia,psig,AccF[0],GyrF[0],fusion);  
-                pc.printf("$%f %f %f;\n",AccF[0],GyrF[0],fusion);  
+                char ligne[50];
+                sprintf(ligne,"$%f %f %f;\n",AccF[0],GyrF[0],fusion); 
+                pc.write(ligne,strlen(ligne)); 
                 
             }
             cpt++;