assert1

Dependencies:   mbed X_NUCLEO_IHM02A1

Files at this revision

API Documentation at this revision

Comitter:
JimmyAREM
Date:
Sat Mar 30 15:10:23 2019 +0000
Parent:
2:977799d72329
Commit message:
odo

Changed in this revision

hardware.cpp 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
reglages.h Show annotated file Show diff for this revision Revisions of this file
diff -r 977799d72329 -r 06cbe2f6c494 hardware.cpp
--- a/hardware.cpp	Sat Feb 23 16:30:08 2019 +0000
+++ b/hardware.cpp	Sat Mar 30 15:10:23 2019 +0000
@@ -8,16 +8,16 @@
 // PWM_MAX est définit dans réglage;
 bool moteurs_arret = false;
 
-DigitalIn tirette(D9);
+DigitalIn tirette(PB_8);
 
 
 XNucleoIHM02A1 *x_nucleo_ihm02a1; //Création d'une entité pour la carte de contôle des pas à pas
 L6470_init_t init[L6470DAISYCHAINSIZE] = {
     /* First Motor. */
      {
-        12.0,                           /* Motor supply voltage in V. */
+        4.08,                           /* Motor supply voltage in V. */ //4.08
         400,                           /* Min number of steps per revolution for the motor. */
-        7.5,                           /* Max motor phase voltage in A. */
+        3,                           /* Max motor phase voltage in A. */ 
         7.06,                          /* Max motor phase voltage in V. */
         300.0,                         /* Motor initial speed [step/s]. */
         500.0,                         /* Motor acceleration [step/s^2] (comment for infinite acceleration mode). */
@@ -43,9 +43,9 @@
 
     /* Second Motor. */
     {
-        12.0,                           /* Motor supply voltage in V. */
+        4.08,                           /* Motor supply voltage in V. */
         400,                           /* Min number of steps per revolution for the motor. */
-        7.5,                           /* Max motor phase voltage in A. */
+        3,                           /* Max motor phase voltage in A. */ //7.5 
         7.06,                          /* Max motor phase voltage in V. */
         300.0,                         /* Motor initial speed [step/s]. */
         500.0,                         /* Motor acceleration [step/s^2] (comment for infinite acceleration mode). */
@@ -74,7 +74,7 @@
 
 DigitalOut led(LED2);
 Serial pc(USBTX, USBRX); // tx, rx
-DevSPI dev_spi(D11, D12, D13); //pour la F746ZG, connecter D13 et D3 par un fil 
+DevSPI dev_spi(D11, D12, D3); //pour la F746ZG, connecter D13 et D3 par un fil 
 
 
 //Connections codeuses
diff -r 977799d72329 -r 06cbe2f6c494 main.cpp
--- a/main.cpp	Sat Feb 23 16:30:08 2019 +0000
+++ b/main.cpp	Sat Mar 30 15:10:23 2019 +0000
@@ -13,17 +13,19 @@
     init_odometrie();
     init_hardware();
     printf("I'm waked up after init...\n");
-    while(tirette) ;    while(!tirette) ;
-    while(tirette) ;
-    //wait(1);
-    
     printf("tirette passee\n");
-
-    
-    /*test_ligne_droite(150000, -100);
-    test_rotation_rel(180,50);
-    test_ligne_droite(150000,-100);
-    test_rotation_rel(180,50);*/
+while(1)
+{
+    while(tirette.read()==0)
+    {
+        }
+    set_PWM_moteur_G(300);
+    set_PWM_moteur_D(285);
+}
+   // test_ligne_droite(150000, -100);
+    test_rotation_rel(90,50);
+   // test_ligne_droite(150000,-100);
+   // test_rotation_rel(90,50);
     //test_ligne_droite(20000,-100);
     //test_rotation_rel(-90,50);
 
@@ -50,11 +52,11 @@
     //afficher_terrain();
     
     
-    aller_a_point(20,180,270,180);
+    //aller_a_point(20,180,270,180);
     
-    aller_a_point(270,180,20,180);
+    //aller_a_point(270,180,20,180);
    
-    test_rotation_rel(180,100);
+    //test_rotation_rel(180,100);
 
     return 0;
 }
diff -r 977799d72329 -r 06cbe2f6c494 reglages.h
--- a/reglages.h	Sat Feb 23 16:30:08 2019 +0000
+++ b/reglages.h	Sat Mar 30 15:10:23 2019 +0000
@@ -1,5 +1,5 @@
 //définition du debug 
-//#define DEBUG_POSITION
+#define DEBUG_POSITION
 
 //position initiale du robot
 #define X_INIT 0
@@ -7,7 +7,7 @@
 #define THETA_INIT 0
 
 //propre a chaque robot
-#define ECART_ROUE 30000 // a augmenter si l'angle reel est plus grand que l'angle vise
+#define ECART_ROUE 22800 // a augmenter si l'angle reel est plus grand que l'angle vise
 #define DIAMETRE_ROUE 8410
 #define DISTANCE_PAR_TICK_D 100000/11600
 #define DISTANCE_PAR_TICK_G 100000/11600