homologation gros robot et test avec les ack de la carte a tout faire

Fork of CRAC-Strat_2017_HOMOLOGATION_PETIT_ROBOT by CRAC Team

Revision:
18:cc5fec34ed9c
Parent:
16:7321fb3bb396
--- a/peripheriques/peripheriques.h	Fri May 19 17:14:07 2017 +0000
+++ b/peripheriques/peripheriques.h	Mon May 22 15:01:49 2017 +0000
@@ -4,31 +4,83 @@
 #include "global.h"
 
 #define VITESSE 700
+#define TIME 0.01
+#define T_MOT 0.00005
 
-/*
-DigitalIn IO1(p23);
-DigitalIn IO2(p24);
-DigitalIn IO3(p25);
-DigitalIn IO4(p26);
+
+#define AX12_PINCE_CENTRALE_POSITION_INITIALE 1
+#define AX12_PINCE_CENTRALE_PREPARATION_PRISE 2
+#define AX12_PINCE_CENTRALE_PRISE_MODULE 3
+#define AX12_PINCE_CENTRALE_STOCKAGE_HAUT 4
+#define AX12_PINCE_CENTRALE_STOCKAGE_BAS 5
+#define AX12_PINCE_CENTRALE_PREPARATION_DEPOT 6
+#define AX12_PINCE_CENTRALE_DEPOSER 7
+#define AX12_PINCE_CENTRALE_DEPOT_HAUT 8
+
+#define AX12_GAUCHE_CROC_OUVERT 11
+#define AX12_GAUCHE_CROC_FERME 12
+#define AX12_DROIT_CROC_INITIALE 13
+
+
+#define AX12_DROIT_CROC_OUVERT 14
+#define AX12_DROIT_CROC_FERME 15
+#define AX12_GAUCHE_CROC_INITIALE 16
+
+#define AX12_TOURNANTE_GAUCHE_POSITION_INITIALE 21
+#define AX12_TOURNANTE_GAUCHE_PREPARATION 22
+#define AX12_TOURNANTE_GAUCHE_MODULE 23
+
+#define AX12_TOURNANTE_DROIT_POSITION_INITIALE 24
+#define AX12_TOURNANTE_DROIT_PREPARATION 25
+#define AX12_TOURNANTE_DROIT_MODULE 26
+
+#define AX12_POSITION 100
+#define AX12_DEFAUT 0
 
-AnalogIn A_in1(p15);
-AnalogIn A_in2(p16);
-AnalogIn A_in3(p17);
-AnalogIn A_in4(p18);
-AnalogIn A_in5(p19);
-AnalogIn A_in6(p20);
+#define AX12_DOIGT 4
+#define AX12_BASE 5
+#define AX12_COUDE 6
+#define AX12_PINCEG 7
+#define AX12_PINCED 8
+#define AX12_GAUCHE_EPAULE 1
+#define AX12_GAUCHE_COUDE 2
+#define AX12_DROIT_EPAULE 9
+#define AX12_DROIT_COUDE 10
+
+#define TOLERANCE_AX12 50
+               
+         /*       PROTOTYPES DE FONCTIONS ET POINTEURS       */
+                    
+
+
+/****************************************************************************************/
+/* FUNCTION NAME: Fin_action                                                            */
+/* DESCRIPTION  : Fonction qui confirme la fin de mouvement des AX12                    */
+/****************************************************************************************/
+void Fin_action(void);
 
-PwmOut IRL_1(p21);
-PwmOut IRL_2(p22);
-*/
+
+/****************************************************************************************/
+/* FUNCTION NAME: Initialisation_position                                               */
+/* DESCRIPTION  : Fonction qui place les bras en position verticale                     */
+/****************************************************************************************/
+void Initialisation_position(unsigned char choix);
 
-#define TIME 1
-#define T_MOT 0.00005
-/*********************************************************************************************************/
-/* FUNCTION NAME: initAX12                                                                               */
-/* DESCRIPTION  : initialise les AX12                                                                    */
-/*********************************************************************************************************/
-void initAX12(void);
+void mvtBrasCentralPR(unsigned char ID1, unsigned short GSpeed1, unsigned short GPosition1, 
+                              unsigned char ID2, unsigned short GSpeed2, unsigned short GPosition2,
+                              unsigned char ID3, unsigned short GSpeed3, unsigned short GPosition3,
+                              unsigned char ID4, unsigned short GSpeed4, unsigned short GPosition4,
+                              unsigned char ID5, unsigned short GSpeed5, unsigned short GPosition5);
+                              
+void mvtBrasGauchePR(unsigned char ID1, unsigned short GSpeed1, unsigned short GPosition1, 
+                              unsigned char ID2, unsigned short GSpeed2, unsigned short GPosition2);                              
+                        
+void mvtBrasDroitPR(unsigned char ID1, unsigned short GSpeed1, unsigned short GPosition1, 
+                    unsigned char ID2, unsigned short GSpeed2, unsigned short GPosition2);  
+
+void initialisation_AX12(void);
+
+void AX12_automate(unsigned char etat_ax12);
 
 /*********************************************************************************************************/
 /* FUNCTION NAME: moteurGauchePWM                                                                        */
@@ -50,80 +102,6 @@
 
 /*       PROTOTYPES DE FONCTIONS ET POINTEURS       */
                     
-void declarationAX12(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Initialisation_position                                               */
-/* DESCRIPTION  : Fonction qui place les bras en position verticale                     */
-/****************************************************************************************/
-void Initialisation_position(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Preparation_prise                                                     */
-/* DESCRIPTION  : Fonction qui prepare le robot pour prendre les modules                */
-/****************************************************************************************/
-void Preparation_prise(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Stockage_haut                                                         */
-/* DESCRIPTION  : Fonction qui prend et stocke les modules dans la position haute       */
-/****************************************************************************************/
-void Stockage_haut(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Stockage_bas                                                          */
-/* DESCRIPTION  : Fonction qui prend et stocke un module dans la pince                  */
-/****************************************************************************************/
-void Stockage_bas(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Deposer                                                               */
-/* DESCRIPTION  : Fonction qui permet de déposer un module                              */
-/****************************************************************************************/
-void Deposer(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Preparation_depos_bas                                                 */
-/* DESCRIPTION  : Fonction qui prépare le depos d'un module en bas                      */
-/****************************************************************************************/
-void Preparation_depot_bas(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Preparation_depos_haut                                                */
-/* DESCRIPTION  : Fonction qui prépare le depos d'un module en haut                     */
-/****************************************************************************************/
-void Preparation_depot_haut(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Pousser_module                                                        */
-/* DESCRIPTION  : Fonction qui permet pousser le module situé à l'entrée de la bas      */
-/****************************************************************************************/
-void Pousser_module(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Initialisation_gauche                                                 */
-/* DESCRIPTION  : Fonction qui permet de placer le cote gauche en position initiale     */
-/****************************************************************************************/
-void Initialisation_gauche(void);
-    
-/****************************************************************************************/
-/* FUNCTION NAME: Preparation_prise_gauche                                              */
-/* DESCRIPTION  : Fonction qui permet prendre un module sur le cote gauche              */
-/****************************************************************************************/
-void Preparation_prise_gauche(void);
-
-/****************************************************************************************/
-/* FUNCTION NAME: Prendre_module_gauche                                                 */
-/* DESCRIPTION  : Fonction qui permet prendre un module sur le cote gauche              */
-/****************************************************************************************/
-void Prendre_module_gauche(void);
-
-/***************************************************************************************/
-/* FUNCTION NAME: RangerBrasGauche                                                     */
-/* DESCRIPTION  : Fonction range le bras gauche                                         */
-/****************************************************************************************/
-void RangerBrasGauche(void);
-
 /****************************************************************************************/
 /* FUNCTION NAME: Tourner_module_gauche                                                 */
 /* DESCRIPTION  : Fonction qui permet de tourner les modules a gauche                   */
@@ -131,24 +109,16 @@
 void Tourner_module_gauche(void);
 
 /****************************************************************************************/
-/* FUNCTION NAME: Preparatio_module_gauche                                              */
-/* DESCRIPTION  : Fonction qui prepare le tournante                                     */
+/* FUNCTION NAME: Tourner_module_droit                                                  */
+/* DESCRIPTION  : Fonction qui permet de tourner les modules a gauche                   */
 /****************************************************************************************/
-void Preparation_module_gauche(void);
-
-void getPosiotionCentrale(void);
-void getPosiotionGauche(void);
-void getPosiotionDroite(void);
-
-
-
-
+void Tourner_module_droit(void);
 
 
 bool dataCouleurGauche(void);
 bool dataCouleurDroit(void);
-short dataTelemetre(void);
+unsigned short dataTelemetre(void);
 bool dataPressionGauche(void);
 bool dataPressionDroit(void);
 
-#endif
\ No newline at end of file
+#endif