mbed-os github

Dependencies:   ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep

Fork of ARNSRS_testDFU by POTLESS

Revision:
45:61ba3cc4fc55
Parent:
44:5cd6f84a62ec
Child:
46:28298df0ac55
diff -r 5cd6f84a62ec -r 61ba3cc4fc55 main.cpp
--- a/main.cpp	Fri May 04 08:13:31 2018 +0000
+++ b/main.cpp	Sat May 05 17:21:12 2018 +0000
@@ -7,6 +7,8 @@
 #include "Utils.h"
 
 //Commandes  des servos
+
+DigitalOut E5V (PA_4);
 #define PWM_SERVO_POUMON PB_15
 #define nSleep_SERVO_POUMON PC_6
 #define FWD_SERVO_POUMON PB_14
@@ -37,8 +39,8 @@
 Faulhaber Servo_Fuite("Servo_Fuite", PWM_SERVO_FUITE, nSleep_SERVO_FUITE, FWD_SERVO_FUITE, REV_SERVO_FUITE, Channel_A_SERVO_FUITE, Channel_B_SERVO_FUITE, 16, 207, Faulhaber::X2_ENCODING);
 
 //Moniteur série, Serial 2
-Serial serialMonit(PC_10, PC_11, 115200); // UART 3 pour windev nucleo - version définitive sur uart3 pour carte ARNSRS
-//Serial serialMonit(PA_2, PA_3,115200); // UART2 à décommenter pour carte ARNSRS
+//Serial serialMonit(PC_10, PC_11, 115200); // UART 3 pour windev nucleo - version définitive sur uart3 pour carte ARNSRS
+Serial serialMonit(PA_2, PA_3,115200); // UART2 à décommenter pour carte ARNSRS
 
 //Communication avec l'IHM
 //Serial display(PC_4, PC_5, 115200);
@@ -108,7 +110,7 @@
 float volet_poumon_Position = 0;
 float Consigne_fuite = 0;
 float volet_fuite_Position = 0;
-float Volets_Speed = 0.1;
+float Volets_Speed = 1;
 float Volet_DeadBand = 5;
 
 //Paramètre du PID
@@ -609,8 +611,10 @@
         UTILS::Store_A_Val(000, "ARNSRS_ID.sys");
         DEBUG("ARNSRS ID forcée à 000\r\n");
     }
-
-    //OUTPUT("\r\n\r\n  Démarrage de l'appareil, veuillez patienter...\r\n\r\n");
+    /*
+while(1){
+    OUTPUT("\r\n\r\n  Démarrage de l'appareil, veuillez patienter...\r\n\r\n");}
+    */
 
     //Vérification RTC, si on est le 01/01/70, c'est qu'il y a un problème...
     seconds = time(NULL);
@@ -710,11 +714,14 @@
     //OUTPUT("  Cliquez sur le bouton help pour voir la liste des \r\n  commandes administrateur disponibles.\r\n");
 
     
-    OUTPUT("$\r\n");
+    //OUTPUT("$\r\n");
     wait(0.5);
     UTILS::Dir_Flash(&serialMonit);
+    OUTPUT("  Flash OK\r\n");
 
     serialMonit.attach(&callbackParam, Serial::RxIrq);
+    
+    E5V=1;
 
     while (true) {
 
@@ -787,7 +794,7 @@
         //Update du PID
         control_Servo.setProcessValue(ppO2);
         //Nouvelle sortie servo fuite si on est pas en mode SECU
-        if(!EN_MODE_SECU) Consigne_fuite = control_Servo.compute();
+        //if(!EN_MODE_SECU) Consigne_fuite = control_Servo.compute();
 
         //Arrêt du Timer mesurant le temps d'éxecution du code
         REAL_RATE.stop();