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
Diff: main.cpp
- Revision:
- 16:b066e4d6e442
- Parent:
- 15:f8c5007343f9
diff -r f8c5007343f9 -r b066e4d6e442 main.cpp
--- a/main.cpp Thu Jun 06 14:38:58 2019 +0000
+++ b/main.cpp Thu Jun 06 15:23:30 2019 +0000
@@ -33,7 +33,7 @@
void update_direction(float* list_lidar_var, float* vecteur)
{
- pc.printf("Update commence\n\r");
+ //pc.printf("Update commence\n\r");
// Fonction de mise à jour de la direction
float direction[2];
int i;
@@ -106,7 +106,7 @@
//avg_y /= sum_inv_dist;
direction[0] = avg_x;
direction[1] = avg_y;
- pc.printf("Update termine\n\r");
+ //pc.printf("Update termine\n\r");
// mise à jour de la direction
for(i=0; i<2; i++)
vecteur[i] = direction[i];
@@ -127,7 +127,7 @@
//y = 1;
angle = atan2(y,x);
angle = angle*180/3.14;
- pc.printf("Angle : %f\n\r",angle);
+ //pc.printf("Angle : %f\n\r",angle);
//pwm = 14.662756 * angle + 1453.08; // à refaire
pwm = -13.30 * angle + 1376.75;
@@ -225,11 +225,11 @@
if(tableau_en_cours == 0)
update_direction(tableau_distance1, dir); // mise à jour à la direction
else update_direction(tableau_distance0, dir); // mise à jour à la direction
- pc.printf("direction,%f,%f\n\r",dir[0],dir[1]);
+ //pc.printf("direction,%f,%f\n\r",dir[0],dir[1]);
pwm_direction_value = angle_servo(dir); // calcul du pwm
}
- if (1) {
+ if (run==true) {
// vitesse constante
pwm_moteur.pulsewidth_us(1440);
pwm_direction.pulsewidth_us(pwm_direction_value); // commande du pwm du moteur