Alexandre Salconi-Denis / Mbed 2 deprecated ProjetOctopode

Dependencies:   debug mbed

Files at this revision

API Documentation at this revision

Comitter:
salco
Date:
Mon Apr 27 20:41:21 2015 +0000
Parent:
18:3f113f8441b2
Child:
20:c825e7b07af7
Commit message:
modification de homemade s?quence pour simplifier le codage et la modification future des s?quence si besoin est.

Changed in this revision

directive.cpp Show annotated file Show diff for this revision Revisions of this file
directive.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
source/Motrice/Patte.h Show annotated file Show diff for this revision Revisions of this file
source/Motrice/homemadeSequence.cpp Show annotated file Show diff for this revision Revisions of this file
source/Motrice/homemadeSequence.h Show annotated file Show diff for this revision Revisions of this file
source/Motrice/mouvement.cpp Show annotated file Show diff for this revision Revisions of this file
source/Motrice/mouvement.h Show annotated file Show diff for this revision Revisions of this file
source/Task/TTask.h Show annotated file Show diff for this revision Revisions of this file
source/Task/TTaskCritique.cpp Show annotated file Show diff for this revision Revisions of this file
source/Task/TTaskCritique.h Show annotated file Show diff for this revision Revisions of this file
--- a/directive.cpp	Thu Apr 23 19:28:42 2015 +0000
+++ b/directive.cpp	Mon Apr 27 20:41:21 2015 +0000
@@ -4,39 +4,106 @@
 Directive::Directive():TTask(0)//on veux que cette tache sois exec toute les fois que TTaskGen sexecute.
 {
     c=0;
-
-   // ctrDesPattes = new Faculter_motrice(/*ssc32*/pc);
+    ssc32 = new Serial(PA_9, PA_10);
+    ctrDesPattes = new Faculter_motrice(ssc32/*pc*/);
+    //m_CtrlBridge = m_CtrlBridge->getInstance();
+    //a enlever de commentaire//m_ListDesModules = m_CtrlBridge->findModule(0,1,0,0);
 }
 Directive::~Directive()
 {
 
     if(ctrDesPattes)
         delete ctrDesPattes;
+    if(ssc32)
+        delete ssc32;
 }
 void Directive::task(void)//ALL CODE HERE//
 {
+    debug(DEBUG_DIRECTIVE_TEST,"\n\rIn task directive");
+    //pas sur que c'Est tout ce qui doit etre ici mais je vois pas quoi d'autre pour le moment.
+    string flag,data,savedData;
+    DigitalOut myled(LED1);
+    DigitalIn mybutton(USER_BUTTON);
 
-   wait(1);// a enlever plus tard pour gain de vitesse//
+    
+    //wait(1);// a enlever plus tard pour gain de vitesse//
     ////////////////
 // Inspection //
 ////////////////
 
-/*    if(pc->readable()) {
-        c=pc->getc();//pc.scanf ("%79s",str);
-        pc->printf("AK %c\n",c);//pc.printf("AK %s\n",str);// pc.printf("This program is %d .\n", i);
+    savedData.clear();
+
+   /* for(int i=0; i<m_ListDesModules.length(); ++i) {
+        flag.clear();
+        data.clear();
+        debug("\n\r result: %d",m_CtrlBridge->send(m_ListDesModules.at(i),flag,data));
+        if(data[0]!= 0x00)
+            savedData.append(data);
     }*/
+    int buttonCount;
+    for(buttonCount =0; mybutton == 0; buttonCount++){
+        debug(DEBUG_DIRECTIVE_TEST,"\n\r %02i",buttonCount+1);
+        wait(1);
+        myled = 1;
+        wait_ms(500);
+        myled = 0;
+        }
+debug(DEBUG_DIRECTIVE_TEST,"\n\rResult : %02i",buttonCount);
 
 //////////////////////////////
 // Traitement du Labyrinthe //
 //////////////////////////////
-/*    if (c == 'g') {
-        ctrDesPattes->calibre();
-        c=0;
-    }
-    if(c == 'h') {
-        pc->printf(" ID seq: %i \n\r",ctrDesPattes->get_idSeq());
-        c=0;
+
+    switch(buttonCount){
+        case 2:
+            ctrDesPattes->calibre();
+            ctrDesPattes->exec();
+        break;
+        
+        case 6:
+            ctrDesPattes->stop();
+            ctrDesPattes->exec();
+            ctrDesPattes->resume();
+        break;
+        
+        case 3:
+            ctrDesPattes->moveUp();
+            ctrDesPattes->exec();
+        break;
+                
+        case 4:
+            ctrDesPattes->moveDown();
+            ctrDesPattes->exec();
+        break;  
+
+        case 5:
+            //ctrDesPattes->stop();
+            //ctrDesPattes->exec();
+            ctrDesPattes->resume();
+        break;
+        
+        case 1:
+            //ctrDesPattes->stop();
+            ctrDesPattes->exec();
+            //ctrDesPattes->resume();
+        break;
+                      
+        default:
+        break;
+        }
+        
+   /* if(savedData.size() != 0)
+    {
+          ctrDesPattes->exec();
     }*/
+    /*    if (c == 'g') {
+            ctrDesPattes->calibre();
+            c=0;
+        }
+        if(c == 'h') {
+            pc->printf(" ID seq: %i \n\r",ctrDesPattes->get_idSeq());
+            c=0;
+        }*/
 ///////////////
 // Mouvement //
 ///////////////
@@ -49,6 +116,6 @@
 // Autre? //
 ////////////
 
-
+debug(DEBUG_DIRECTIVE_TEST,"\n\rOut task directive");
 
 }
\ No newline at end of file
--- a/directive.h	Thu Apr 23 19:28:42 2015 +0000
+++ b/directive.h	Mon Apr 27 20:41:21 2015 +0000
@@ -8,14 +8,18 @@
 #ifndef DIRECTIVE_H
 #define DIRECTIVE_H
 
+#define DEBUG_DIRECTIVE_TEST 1
+
 #include "mbed.h"
+#include "debug.h"
 #include "source/Task/TTask.h"
 #include "Motrice/mouvement.h"
 
 class Directive : public TTask
 {
-
+    CtrlBridge* m_CtrlBridge;
     Faculter_motrice *ctrDesPattes;
+    Serial *ssc32;
     char c;
 protected:
     virtual void task(void);
--- a/main.cpp	Thu Apr 23 19:28:42 2015 +0000
+++ b/main.cpp	Mon Apr 27 20:41:21 2015 +0000
@@ -16,7 +16,7 @@
 
 
 
-DigitalOut myled(LED1);
+DigitalOut myled(LED1, 0);
 //char str [80];
 DigitalIn mybutton(USER_BUTTON);
 DigitalOut pinA(PA_13);
@@ -31,9 +31,9 @@
     //         string test="allo";
     //    pc.printf(test.c_str());
 
-    TTaskCritique taskCritique(1);
+    //TTaskCritique taskCritique(1);
     // TTaskAlerte taskAlerte(20);
-    // TTaskGeneral  taskGeneral(40);
+     TTaskGeneral  taskGeneral(1);//40);
 //////////
 // Boot //
 //////////
@@ -47,8 +47,8 @@
         //taskGeneral.exec();
         if (mybutton == 0) { // Button is pressed
             //debug("Hello debug world");
-            taskCritique.exec();
-
+            //taskCritique.exec();
+            taskGeneral.exec();
             /*if(myled) {
                 pinB=0;
                 pinA=1;
--- a/source/Motrice/Patte.h	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Motrice/Patte.h	Mon Apr 27 20:41:21 2015 +0000
@@ -69,7 +69,7 @@
     }
     const char* toString(void){
        
-       sprintf (buffer,"#%d P%d #%d P%d #%d P%d #%d P%d",m_Coxa.iD,m_Coxa.curr,m_Femur.iD,m_Femur.curr,m_Tibia.iD,m_Tibia.curr,m_Tars.iD,m_Tars.curr);
+       sprintf (buffer,"#%d P%d0 #%d P%d0 #%d P%d0 #%d P%d0",m_Coxa.iD,m_Coxa.curr,m_Femur.iD,m_Femur.curr,m_Tibia.iD,m_Tibia.curr,m_Tars.iD,m_Tars.curr);
        return buffer;
         }
     //setting Coxa //
@@ -232,7 +232,7 @@
             m_Tars.curr = value;
     }
     void move(unsigned char coxaValue,unsigned char femurValue,
-              unsigned char tibiaValue,unsigned char tarsValue) {
+              unsigned char tibiaValue,unsigned char tarsValue) {//noob proof
         if((coxaValue >= m_Coxa.min)&&(coxaValue <= m_Coxa.max ))
             m_Coxa.curr = coxaValue;
         if((femurValue >= m_Femur.min)&&(femurValue <= m_Femur.max ))
--- a/source/Motrice/homemadeSequence.cpp	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Motrice/homemadeSequence.cpp	Mon Apr 27 20:41:21 2015 +0000
@@ -5,10 +5,47 @@
  *      Author: salco
  */
 #include "homemadeSequence.h"
+unsigned char table_seqUp[9][2][3] =     { { {80 , 210, 160}, {220, 90 , 114} },
+                                           { {80 , 220, 170}, {220, 80 , 130} },
+                                           { {90 , 220, 160}, {200, 80 , 140} },
+                                           { {106, 220, 150}, {194, 80 , 150} },
+                                           { {128, 220, 127}, {172, 80 , 173} },
+                                           { {144, 205, 130}, {156, 95 , 170} },
+                                           { {144, 210, 123}, {156, 89 , 177} },
+                                           { {172, 185, 124}, {128, 115, 176} },
+                                           { {194, 166, 118}, {106, 134, 182} } };
+                                           
+unsigned char table_seqDown[9][2][3] =   { { {172, 185, 124}, {128, 115, 176} },
+                                           { {172, 185, 124}, {128, 115, 176} },
+                                           { {144, 210, 123}, {156, 89 , 177} },
+                                           { {144, 205, 130}, {156, 95 , 170} },
+                                           { {128, 220, 127}, {172, 80 , 173} },
+                                           { {106, 220, 150}, {194, 80 , 150} },
+                                           { {90 , 220, 160}, {200, 80 , 140} },
+                                           { {80 , 220, 170}, {220, 80 , 130} },
+                                           { {80 , 100, 150}, {220, 200, 150} } };//fin de la seq il met ses patte sur sa tete**
+/*unsigned char table_seqUpDown[9][8][4] = { { {140, 80, 210, 160}, {165, 80, 210, 160}, {160, 80, 210, 160}, {150, 80, 210, 160},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
+                                           { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
+                                             {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} } };*/
 homemadeSequence::homemadeSequence()
 {
-m_SequenceChosen=0;
-m_idFrame=0;
+    m_SequenceChosen=0;
+    m_idFrame=0;
 }
 homemadeSequence::~homemadeSequence()
 {
@@ -16,11 +53,14 @@
 }
 unsigned char* homemadeSequence::get_frame(/*char idSequence,char idOperation,*/char idLeg)
 {
+    debug(DEBUG_HOMEMADE_GETFRAME,"\n\r    In Get Frame");
     m_posLeg[0] = 0;
     m_posLeg[1] = 0;
     m_posLeg[2] = 0;
     m_posLeg[3] = 0;
-
+    debug(DEBUG_HOMEMADE_GETFRAME,"\n\r    idLeg: %i",idLeg);
+    debug(DEBUG_HOMEMADE_GETFRAME,"\n\r    m_SequenceChosen: %i",m_SequenceChosen);
+    debug(DEBUG_HOMEMADE_GETFRAME,"\n\r    m_idFrame: %i",m_idFrame);
     switch(m_SequenceChosen) {
         case 1:// 01 - Calibration(milieu) //
             if(m_idFrame == 1) {//if(idOperation == 1) {
@@ -28,6 +68,11 @@
                 m_posLeg[1] = 150;
                 m_posLeg[2] = 150;
                 m_posLeg[3] = 150;
+            } else {
+                m_posLeg[0] = 0;
+                m_posLeg[1] = 0;
+                m_posLeg[2] = 0;
+                m_posLeg[3] = 0;
             }
             break;
 
@@ -52,13 +97,15 @@
         case 10:// 10 - Crabe  Droite       //
             break;
     }
+    debug(DEBUG_HOMEMADE_GETFRAME,"\n\r    posLeg: [0]:%i, [1]:%i, [2]:%i, [3]:%i,",m_posLeg[0],m_posLeg[1],m_posLeg[2],m_posLeg[3]);
+    debug(DEBUG_HOMEMADE_GETFRAME,"\n\r    Out Get Frame");
     return m_posLeg;
 }
 
 void homemadeSequence::seqUpDown(bool downUP,char idOperation,char idLeg)
 {
     if((idOperation<10)&&(idOperation>0)) {
-        switch(idLeg) {
+        switch(idLeg) { //moving hips
             case 1:
                 m_posLeg[0] = 140;
                 break;
@@ -78,7 +125,21 @@
                 m_posLeg[0] = 150;
                 break;
         }
-        if(idOperation == 1) {
+         if(downUP)
+         {
+            if(idLeg<5)
+                for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqUp[idOperation-1][0][i-1];
+            else
+                for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqUp[idOperation-1][1][i-1];
+         }
+         else
+         {
+            if(idLeg<5)
+                for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqDown[idOperation-1][0][i-1];
+            else
+                for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqDown[idOperation-1][1][i-1];
+         }
+        /*if(idOperation == 1) {
             if(idLeg<5) {
                 m_posLeg[1] = 80;
                 m_posLeg[2] = 210;
@@ -106,9 +167,9 @@
             }
 
             switch(idOperation) {
-                    /*case 1:
+                    case 1:
 
-                        break;*/
+                        break;
                 case 2:
                     if(idLeg<5) {
                         m_posLeg[1] = 80;
@@ -197,8 +258,14 @@
                         m_posLeg[3] = 182;
                     }
                     break;
+                default:
+                    m_posLeg[0] = 0;
+                    m_posLeg[1] = 0;
+                    m_posLeg[2] = 0;
+                    m_posLeg[3] = 0;
+                    break;
             }
-        }
+        }*/
     }
 }
 void homemadeSequence::seqTurn(bool leftRIGHT,char idOperation,char idLeg)
@@ -211,29 +278,48 @@
 {}
 bool homemadeSequence::next_frame(void)
 {
-    bool temp=true;
+    debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r    in Next Frame");
+    bool temp=false;
+    debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r    m_idframe == %d",m_idFrame);
+
+    //if(m_idFrame > 1){
     m_idFrame++;
-    unsigned char* tmpTable = get_frame(m_idFrame+1);
-    
-    if((tmpTable[0]==0) && (tmpTable[1]==0) && (tmpTable[2]==0) && (tmpTable[3]==0)) {
-        temp=false;
-        m_idFrame--;//get_frame(m_idFrame);
-    }/* else
-        m_idFrame++;*/
+    unsigned char* tmpTable = get_frame(1);
 
+    if((tmpTable[0]!=0) && (tmpTable[1]!=0) && (tmpTable[2]!=0) && (tmpTable[3]!=0)) //{
+        temp=true;
+    //m_idFrame++;//get_frame(m_idFrame);
+    //}
+    else
+        m_idFrame--;
+
+    //}
+    //}
+    debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r    m_idframe == %d",m_idFrame);
+    debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r    out Next Frame");
     return temp;
 }
-bool homemadeSequence::prev_frame(void)
+bool homemadeSequence::prev_frame(void)   //true == prev is ok
 {
-    bool temp=true;
-    m_idFrame--;
-    unsigned char* tmpTable = get_frame(1);
-    
-    if((tmpTable[0]==0) && (tmpTable[1]==0) && (tmpTable[2]==0) && (tmpTable[3]==0)) {
-        temp=false;
-        m_idFrame++;//get_frame(m_idFrame);
-    } /*else
-        m_idFrame--;*/
+    //false == impossible
+    debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r    in Prev Frame");
+    bool temp=false;
+    debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r    m_idframe == %d",m_idFrame);
+
+    if(m_idFrame > 1) {
+        m_idFrame--;
+        unsigned char* tmpTable = get_frame(1);
 
+        if((tmpTable[0]!=0) && (tmpTable[1]!=0) && (tmpTable[2]!=0) && (tmpTable[3]!=0)) //{
+            temp=true;
+        //m_idFrame++;//get_frame(m_idFrame);
+        //}
+        else
+            m_idFrame++;
+
+        //}
+    }
+    debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r    m_idframe == %d",m_idFrame);
+    debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r    out Prev Frame");
     return temp;
 }
\ No newline at end of file
--- a/source/Motrice/homemadeSequence.h	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Motrice/homemadeSequence.h	Mon Apr 27 20:41:21 2015 +0000
@@ -7,6 +7,13 @@
 
 #ifndef HOMEMADESEQUENCE_H_
 #define HOMEMADESEQUENCE_H_
+
+#define DEBUG_HOMEMADE_GETFRAME 1
+#define DEBUG_HOMEMADE_NEXTFRAME 0
+#define DEBUG_HOMEMADE_PREVFRAME 0
+
+#include "debug.h"
+
 class homemadeSequence
 {
     //////////////////////////////
@@ -26,6 +33,7 @@
     char m_idFrame;
 
     unsigned char m_posLeg[4];
+    
 
     void seqUpDown(bool downUP,char idOperation,char idLeg);
     void seqTurn(bool leftRIGHT,char idOperation,char idLeg);
--- a/source/Motrice/mouvement.cpp	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Motrice/mouvement.cpp	Mon Apr 27 20:41:21 2015 +0000
@@ -58,42 +58,40 @@
 }
 void Faculter_motrice::exec(void)
 {
-#ifdef DEBUG
-    m_com->printf("Flag in exec [%i  :: %i ] \n\r",m_ForceStop,m_seq->get_Sequence());
-#endif
+    debug(DEBUG_MOUVEMENT,"\n\r In Faculter Mott");
+    debug(DEBUG_MOUVEMENT,"\n\r  Flag in exec [%i  :: %i ] \n\r",m_ForceStop,m_seq->get_Sequence());
     if((!m_ForceStop)&&(m_seq->get_Sequence() != 0)) {
         unsigned char* tempLeg;
 
 
 
         switch(m_seq->get_Sequence()) {
-            case 1:
+            default:
                 tempLeg=m_seq->get_frame(m_arr_D->id());
                 m_arr_D->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
                 //...//
                 if(m_seq->next_frame() == false) {
                     m_ForceStop=true;
-#ifdef DEBUG
-                    m_com->printf("    Flag next impossible \n\r",m_ForceStop,m_seq->get_Sequence());
-#endif
+
+                    debug(DEBUG_EXEC,"    Flag next impossible \n\r",m_ForceStop,m_seq->get_Sequence());
+
                 }
-                #ifdef DEBUG
                 else
-                    m_com->printf("    Flag next possible \n\r",m_ForceStop,m_seq->get_Sequence());
-#endif
+                    debug(DEBUG_EXEC,"    Flag next possible \n\r",m_ForceStop,m_seq->get_Sequence());
+
                 break;
         }
         //char buffer[50];
         //scanf(buffer,"%s T%d\n\r",m_arr_D->toString(),DELAITESTE);
-        m_com->printf("%s T%d\n\r",m_arr_D->toString(),DELAITESTE);
-
+        //m_com->printf("%s T%d\n\r",m_arr_D->toString(),DELAITESTE); //move to sendSequence()
+        
+        debug(DEBUG_MOUVEMENT,"\n\r   %s T%d\n\r",m_arr_D->toString(),DELAITESTE);
+        sendSequence();
         /*
                     tempLeg=m_seq->get_frame(m_arr_D->id());
         m_com->printf("This program is %d .\n", tempLeg[0]);*/
     }
-#ifdef DEBUG
-    m_com->printf("Flag out exec [%i  :: %i ] \n\r",m_ForceStop,m_seq->get_Sequence());
-#endif
+debug(DEBUG_MOUVEMENT,"\n\r Out Faculter Mott");
 }
 /*void Faculter_motrice::moveLeft (void)
 {
@@ -132,4 +130,34 @@
     m_com->printf("#0L #1L #2L #3L #4L #5L #6L #7L #8L #9L #10L #11L #12L #13L #14L #15L #16L #17L #18L #19L #20L #21L #22L #23L #24L #25L #26L #27L #28L #29L #30L #31L #32L\n\r");
     m_ForceStop=true;
     m_CriticalStop=true;
+}
+
+void Faculter_motrice::sendSequence(void)
+{
+    debug(DEBUG_SENDSEQ,"\n\r   in sendSeq\n\r"); 
+    m_com->printf("%s T%d\n\r",m_arr_D->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_arr_D->toString(),DELAITESTE);
+    
+    m_com->printf("%s T%d\n\r",m_arr_G->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_arr_G->toString(),DELAITESTE);    
+
+    m_com->printf("%s T%d\n\r",m_arr_mil_D->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_arr_mil_D->toString(),DELAITESTE);
+    
+    m_com->printf("%s T%d\n\r",m_arr_mil_G->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_arr_mil_G->toString(),DELAITESTE);
+
+    m_com->printf("%s T%d\n\r",m_avv_mil_D->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_avv_mil_D->toString(),DELAITESTE);
+    
+    m_com->printf("%s T%d\n\r",m_avv_mil_G->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_avv_mil_G->toString(),DELAITESTE);
+
+    m_com->printf("%s T%d\n\r",m_avv_D->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_avv_D->toString(),DELAITESTE);
+
+    m_com->printf("%s T%d\n\r",m_avv_G->toString(),DELAITESTE);
+    debug(DEBUG_SENDSEQ,"\n\r   %s T%d",m_avv_G->toString(),DELAITESTE);
+    
+    debug(DEBUG_SENDSEQ,"\n\r\n\r   out sendSeq");
 }
\ No newline at end of file
--- a/source/Motrice/mouvement.h	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Motrice/mouvement.h	Mon Apr 27 20:41:21 2015 +0000
@@ -24,10 +24,13 @@
 #define MOUVEMENT_H_
 
 #define DELAITESTE 1000
-#define DEBUG
+#define DEBUG_MOUVEMENT 1
+#define DEBUG_EXEC 1
+#define DEBUG_SENDSEQ 1
 
 #include "mbed.h"
 //#include <string>
+#include "debug.h"
 //#include <stdio.h>
 #include "Patte.h"
 #include "homemadeSequence.h"
@@ -64,7 +67,7 @@
 // char m_SequenceChosen;
 // A enlever au plus vite car sa prend beaucoup d'espace //
 
-
+   void sendSequence(void);
 public:
 #ifdef DEBUG
     char get_idSeq(void){return m_seq->get_Sequence();}
@@ -83,30 +86,39 @@
     void crit_stop(void);
     
     void moveLeft (void) {
+        m_ForceStop=false;
         m_seq->set_Sequence(9);
     }
     void moveRight(void){
+        m_ForceStop=false;
         m_seq->set_Sequence(10);
     }
     void moveUp   (void){
+        m_ForceStop=false;
         m_seq->set_Sequence(2);
     }
     void moveDown (void){
+        m_ForceStop=false;
         m_seq->set_Sequence(3);
     }
     void moveFront(void){
+        m_ForceStop=false;
         m_seq->set_Sequence(6);
     }
     void moveBack (void){
+        m_ForceStop=false;
         m_seq->set_Sequence(7);
     }
     void turnLeft (void){
+        m_ForceStop=false;
         m_seq->set_Sequence(4);
     }
     void trunRight(void){
+        m_ForceStop=false;
         m_seq->set_Sequence(5);
     }
     void calibre  (void){
+        m_ForceStop=false;
         m_seq->set_Sequence(1);
     }
     //void repositioner(char idLeg);
--- a/source/Task/TTask.h	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Task/TTask.h	Mon Apr 27 20:41:21 2015 +0000
@@ -22,12 +22,15 @@
 
 protected:
     static TTask *ptrThis;
-    //CtrlBridge* m_CtrlBridge;
+    string m_ListDesModules;
+    CtrlBridge* m_CtrlBridge;
 
 public:
     TTask(int priority=0) {
         m_priority=priority;
         m_priorityCount=0;
+        m_CtrlBridge = m_CtrlBridge->getInstance();
+        
     }
     virtual ~TTask() {
     }
--- a/source/Task/TTaskCritique.cpp	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Task/TTaskCritique.cpp	Mon Apr 27 20:41:21 2015 +0000
@@ -3,7 +3,7 @@
 
 TTaskCritique::TTaskCritique(int priority):TTask(priority)
 {
-    m_CtrlBridge = m_CtrlBridge->getInstance();
+    //m_CtrlBridge = m_CtrlBridge->getInstance();
 
     m_CtrlBridge->initCom();
     m_ListDesModules = m_CtrlBridge->findModule(0,0,0,0); //get all modules
--- a/source/Task/TTaskCritique.h	Thu Apr 23 19:28:42 2015 +0000
+++ b/source/Task/TTaskCritique.h	Mon Apr 27 20:41:21 2015 +0000
@@ -12,13 +12,13 @@
 
 class TTaskCritique : public TTask
 {
-    string m_ListDesModules;
+    //string m_ListDesModules;
     bool tymy;
     
     void forceShutDown(bool offON);
     void criticalTreatment(char adresse);
-    protected:
-    CtrlBridge* m_CtrlBridge;
+    //protected:
+    //CtrlBridge* m_CtrlBridge;
     virtual void task(void);
     
     public: