pixy info2

Dependencies:   CMPS03 SRF05 mbed pixy

Fork of 0000Non_stop_code_v3 by Alexandre Pirotte

Committer:
qj604184
Date:
Thu Jun 22 09:32:24 2017 +0000
Revision:
2:48f7e5f79caa
Parent:
1:99f469d63b9a
pixy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pirottealex 0:a8cee96c9250 1 #ifndef FCT_H
pirottealex 0:a8cee96c9250 2 #define FCT_H
pirottealex 0:a8cee96c9250 3 #include "SRF05.h"
pirottealex 0:a8cee96c9250 4 #include <CMPS03.h>
pirottealex 0:a8cee96c9250 5 extern char cmdI2C ;// CS vbat x x x SensG SensD CS_G CD_D, sens moteur positif CS à 0.
pirottealex 0:a8cee96c9250 6 extern PwmOut MotD;
pirottealex 0:a8cee96c9250 7 extern PwmOut MotG;
pirottealex 0:a8cee96c9250 8 extern int captL1;
pirottealex 0:a8cee96c9250 9 extern int captL3;
qj604184 2:48f7e5f79caa 10 extern float us_arriere,us_droit,us_gauche,gBoussole,cap_set,erreur_ar,flag,erreur_av;
pirottealex 0:a8cee96c9250 11 extern int j,etat,bout;
pirottealex 0:a8cee96c9250 12 extern uint16_t blocks;
qj604184 2:48f7e5f79caa 13 extern float taille,errorX,cap_rot,cap_arriere,cap_avant;
pirottealex 1:99f469d63b9a 14 extern Timer tempo,tempo2;
pirottealex 0:a8cee96c9250 15 //GLOBALES
pirottealex 0:a8cee96c9250 16 extern BusOut leds;
pirottealex 0:a8cee96c9250 17
pirottealex 0:a8cee96c9250 18 extern Serial CamPixy;
pirottealex 0:a8cee96c9250 19
pirottealex 0:a8cee96c9250 20 extern DigitalOut trig1;//US1
pirottealex 0:a8cee96c9250 21 extern InterruptIn echo1;
pirottealex 0:a8cee96c9250 22 extern DigitalOut trig2;//US2
pirottealex 0:a8cee96c9250 23 extern InterruptIn echo2;
pirottealex 0:a8cee96c9250 24 extern DigitalOut trig3;//US3
pirottealex 0:a8cee96c9250 25 extern InterruptIn echo3;
pirottealex 0:a8cee96c9250 26 extern SRF05 us_arr;
qj604184 2:48f7e5f79caa 27 extern SRF05 us_g;
qj604184 2:48f7e5f79caa 28 extern SRF05 us_d;
pirottealex 0:a8cee96c9250 29 extern I2C monI2C;
pirottealex 0:a8cee96c9250 30 extern DigitalOut cs;
pirottealex 0:a8cee96c9250 31 extern PwmOut Servo;
pirottealex 0:a8cee96c9250 32 extern DigitalIn bp;
pirottealex 0:a8cee96c9250 33 extern AnalogIn SD_1; // capteur de distance courte droite
pirottealex 0:a8cee96c9250 34 extern AnalogIn SD_2; // capteur de distance courte gauche
pirottealex 0:a8cee96c9250 35 extern AnalogIn LD_1; // capteur de distance longue droite
pirottealex 0:a8cee96c9250 36 extern AnalogIn LD_2; // capteur de distance longue gauche
pirottealex 0:a8cee96c9250 37 extern CMPS03 Boussole;
pirottealex 0:a8cee96c9250 38 extern InterruptIn I_D;
pirottealex 0:a8cee96c9250 39 extern InterruptIn I_G;
pirottealex 0:a8cee96c9250 40
pirottealex 0:a8cee96c9250 41 extern SPI spi;
pirottealex 0:a8cee96c9250 42
pirottealex 0:a8cee96c9250 43 extern AnalogIn C1;// capteur de ligne blanche 1
pirottealex 0:a8cee96c9250 44 extern AnalogIn C3;// capteur de ligne blanche 3
pirottealex 0:a8cee96c9250 45 //-- le capteur de ligne 2 est sur un MCP3201(spi) dont le CS est sur p13
pirottealex 0:a8cee96c9250 46 extern DigitalOut cs;
pirottealex 0:a8cee96c9250 47
pirottealex 0:a8cee96c9250 48
pirottealex 0:a8cee96c9250 49
pirottealex 0:a8cee96c9250 50 //CONSTANTES
pirottealex 0:a8cee96c9250 51 #define ADR_PCF 0x70
pirottealex 0:a8cee96c9250 52 #define PERIOD 0.0001
qj604184 2:48f7e5f79caa 53 #define V_max 32
pirottealex 0:a8cee96c9250 54 #define V_recherche 18
pirottealex 0:a8cee96c9250 55 #define K 0.1
pirottealex 0:a8cee96c9250 56 #define V_moy 25
pirottealex 0:a8cee96c9250 57
pirottealex 0:a8cee96c9250 58 //PROTOTYPES
pirottealex 0:a8cee96c9250 59 void lecture_blanc(void);
pirottealex 0:a8cee96c9250 60 void vitmoteur(float,float);
pirottealex 0:a8cee96c9250 61 void lecture_us(void);
pirottealex 0:a8cee96c9250 62 void init(void);
pirottealex 0:a8cee96c9250 63 void lecture_boussole(void);
pirottealex 0:a8cee96c9250 64 #endif