Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 2:f5a9120c6c42, committed 2019-05-13
- Comitter:
- Wael_H
- Date:
- Mon May 13 18:21:18 2019 +0000
- Parent:
- 1:23a830355dc5
- Commit message:
- test lasers telemetriques
Changed in this revision
--- 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);
}
- }
+ }*/
}
}