FRC_equipe1 / Mbed 2 deprecated robot_total_3balles_recherche_odo

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Wael_H
Date:
Mon May 13 18:21:18 2019 +0000
Parent:
1:23a830355dc5
Commit message:
test lasers telemetriques

Changed in this revision

robot_frc/CAN_asser.cpp Show annotated file Show diff for this revision Revisions of this file
robot_frc/ejecteur.cpp Show annotated file Show diff for this revision Revisions of this file
robot_general.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/robot_frc/CAN_asser.cpp	Mon May 13 15:47:45 2019 +0000
+++ b/robot_frc/CAN_asser.cpp	Mon May 13 18:21:18 2019 +0000
@@ -22,7 +22,7 @@
     pt_ecriture_can++;
     if(nb_msg_can > 6)
     {
-        dbug.printf("!!!!!! CAN BUFFER OVERFLOW !!!!!!!!\n");
+        //dbug.printf("!!!!!! CAN BUFFER OVERFLOW !!!!!!!!\n");
          pt_lecture_can++;
          nb_msg_can--;
     }
--- a/robot_frc/ejecteur.cpp	Mon May 13 15:47:45 2019 +0000
+++ b/robot_frc/ejecteur.cpp	Mon May 13 18:21:18 2019 +0000
@@ -4,10 +4,16 @@
 //Serial dbug_ejec(PA_0, PA_1, 38400);
 
 //moteur rouleau
-PwmOut pwm_rouleau(D5);
+PwmOut pwm_rouleau(D5); //fil jaune sortant du pont en H
 DigitalOut ejecte(D4);
 DigitalOut gobe(D6);
 
+/***PIN pont en H sur PCB:***/
+//Vert : INA
+//Bleu : INB
+//Jaune : PWM
+
+
 //Timeout buteballe_tim;
 //InterruptIn buteballe(PC_3);
 DigitalIn buteballe(PC_2, PullDown);
--- a/robot_general.cpp	Mon May 13 15:47:45 2019 +0000
+++ b/robot_general.cpp	Mon May 13 18:21:18 2019 +0000
@@ -6,8 +6,8 @@
 InterruptIn UBp_it(USER_BUTTON);
 Timeout ubp_to; 
 
-//Serial dbug(USBTX, USBRX, 115200);   
-Serial dbug(PA_0, PA_1, 38400);
+Serial dbug(USBTX, USBRX, 115200);   
+//Serial dbug(PA_0, PA_1, 38400);
 
 Timer timer_generale;
 
@@ -57,6 +57,9 @@
 void if_UBp();
 void wait_debut_de_partie();
 
+AnalogIn CptD(PC_5);  //premier à droite
+AnalogIn CptG(PB_1);  //deuxieme à droite
+AnalogIn CptA(PC_4);  //troisieme à droite
 
 
 int main() 
@@ -76,9 +79,9 @@
     //BendRadius(139, 900, -1,0);
     //GoStraight(3800,0,0,0);
     dbug.printf("END SETUP\n");
-    while(!match_en_cours){
+    /*while(!match_en_cours){
         trait_can();
-        wait_debut_de_partie();}
+        wait_debut_de_partie();}*/
         
     timer_generale.start();
     //Rotate(3600);
@@ -88,7 +91,11 @@
 
     while(1)
     {
-        if(temps_ecoule > DUREE_MATCH_TIC)
+        //dbug.printf("Capteur droit : %f \n", CptD.read());
+        //dbug.printf("Capteur gauche : %f \n", CptG.read());
+        dbug.printf("Capteur arriere : %f \n", CptA.read());
+        wait(1);
+        /*if(temps_ecoule > DUREE_MATCH_TIC)
         {
             match_en_cours = 0;
             SendRawId(ASSERVISSEMENT_STOP);
@@ -115,7 +122,7 @@
                 dbug.printf("Pos x:%d, y:%d, te:%d, Tecoule:%d\n", pos[0], pos[1], pos[2],temps_ecoule*TIKER_GENERALE_US/1000000);
                 //dbug.printf("Dis D:%f, G:%f, min:%f\n", DTD_avg_Ex, DTG_avg_Ex, DT_avg_min_Ex);
             }
-        }
+        }*/
             
     }
 }