mm
Dependencies: CMPS03 SRF05 mbed pixy
fct.h@0:6c5fac591b01, 2018-02-08 (annotated)
- Committer:
- pirottealex
- Date:
- Thu Feb 08 19:35:15 2018 +0000
- Revision:
- 0:6c5fac591b01
mm
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pirottealex | 0:6c5fac591b01 | 1 | #ifndef FCT_H |
pirottealex | 0:6c5fac591b01 | 2 | #define FCT_H |
pirottealex | 0:6c5fac591b01 | 3 | #include "SRF05.h" |
pirottealex | 0:6c5fac591b01 | 4 | #include <CMPS03.h> |
pirottealex | 0:6c5fac591b01 | 5 | extern char cmdI2C ;// CS vbat x x x SensG SensD CS_G CD_D, sens moteur positif CS à 0. |
pirottealex | 0:6c5fac591b01 | 6 | extern PwmOut MotD; |
pirottealex | 0:6c5fac591b01 | 7 | extern PwmOut MotG; |
pirottealex | 0:6c5fac591b01 | 8 | extern int captL1; |
pirottealex | 0:6c5fac591b01 | 9 | extern int captL3; |
pirottealex | 0:6c5fac591b01 | 10 | extern float us_arriere,gBoussole,cap_set,distance_av; |
pirottealex | 0:6c5fac591b01 | 11 | extern int j,etat,bout,capt_balle; |
pirottealex | 0:6c5fac591b01 | 12 | extern uint16_t blocks; |
pirottealex | 0:6c5fac591b01 | 13 | extern float taille,errorX,cap_rot,capt_av; |
pirottealex | 0:6c5fac591b01 | 14 | extern Timer tempo; |
pirottealex | 0:6c5fac591b01 | 15 | //GLOBALES |
pirottealex | 0:6c5fac591b01 | 16 | extern BusOut leds; |
pirottealex | 0:6c5fac591b01 | 17 | |
pirottealex | 0:6c5fac591b01 | 18 | extern Serial CamPixy; |
pirottealex | 0:6c5fac591b01 | 19 | |
pirottealex | 0:6c5fac591b01 | 20 | extern DigitalOut trig1;//US1 |
pirottealex | 0:6c5fac591b01 | 21 | extern InterruptIn echo1; |
pirottealex | 0:6c5fac591b01 | 22 | extern DigitalOut trig2;//US2 |
pirottealex | 0:6c5fac591b01 | 23 | extern InterruptIn echo2; |
pirottealex | 0:6c5fac591b01 | 24 | extern DigitalOut trig3;//US3 |
pirottealex | 0:6c5fac591b01 | 25 | extern InterruptIn echo3; |
pirottealex | 0:6c5fac591b01 | 26 | extern SRF05 us_arr; |
pirottealex | 0:6c5fac591b01 | 27 | extern I2C monI2C; |
pirottealex | 0:6c5fac591b01 | 28 | extern DigitalOut cs; |
pirottealex | 0:6c5fac591b01 | 29 | extern DigitalIn bp; |
pirottealex | 0:6c5fac591b01 | 30 | extern AnalogIn SD_1; // capteur de distance courte droite |
pirottealex | 0:6c5fac591b01 | 31 | extern AnalogIn SD_2; // capteur de distance courte gauche |
pirottealex | 0:6c5fac591b01 | 32 | extern AnalogIn LD_1; // capteur de distance longue droite |
pirottealex | 0:6c5fac591b01 | 33 | extern AnalogIn LD_2; // capteur de distance longue gauche |
pirottealex | 0:6c5fac591b01 | 34 | extern CMPS03 Boussole; |
pirottealex | 0:6c5fac591b01 | 35 | extern InterruptIn I_D; |
pirottealex | 0:6c5fac591b01 | 36 | extern InterruptIn I_G; |
pirottealex | 0:6c5fac591b01 | 37 | |
pirottealex | 0:6c5fac591b01 | 38 | extern SPI spi; |
pirottealex | 0:6c5fac591b01 | 39 | |
pirottealex | 0:6c5fac591b01 | 40 | extern AnalogIn C1;// capteur de ligne blanche 1 |
pirottealex | 0:6c5fac591b01 | 41 | extern AnalogIn C3;// capteur de ligne blanche 3 |
pirottealex | 0:6c5fac591b01 | 42 | //-- le capteur de ligne 2 est sur un MCP3201(spi) dont le CS est sur p13 |
pirottealex | 0:6c5fac591b01 | 43 | extern DigitalOut cs; |
pirottealex | 0:6c5fac591b01 | 44 | |
pirottealex | 0:6c5fac591b01 | 45 | |
pirottealex | 0:6c5fac591b01 | 46 | |
pirottealex | 0:6c5fac591b01 | 47 | //CONSTANTES |
pirottealex | 0:6c5fac591b01 | 48 | #define ADR_PCF 0x70 |
pirottealex | 0:6c5fac591b01 | 49 | #define PERIOD 0.0001 |
pirottealex | 0:6c5fac591b01 | 50 | #define V_max 25 |
pirottealex | 0:6c5fac591b01 | 51 | #define V_recherche 25 |
pirottealex | 0:6c5fac591b01 | 52 | #define K 0.2 |
pirottealex | 0:6c5fac591b01 | 53 | #define V_moy 30 |
pirottealex | 0:6c5fac591b01 | 54 | #define a 59.6 |
pirottealex | 0:6c5fac591b01 | 55 | #define b 0.1 |
pirottealex | 0:6c5fac591b01 | 56 | |
pirottealex | 0:6c5fac591b01 | 57 | //PROTOTYPES |
pirottealex | 0:6c5fac591b01 | 58 | void lecture_balle(void); |
pirottealex | 0:6c5fac591b01 | 59 | void lecture_blanc(void); |
pirottealex | 0:6c5fac591b01 | 60 | void vitmoteur(float,float); |
pirottealex | 0:6c5fac591b01 | 61 | void lecture_us(void); |
pirottealex | 0:6c5fac591b01 | 62 | void init(void); |
pirottealex | 0:6c5fac591b01 | 63 | void lecture_boussole(void); |
pirottealex | 0:6c5fac591b01 | 64 | void lecture_an(void); |
pirottealex | 0:6c5fac591b01 | 65 | #endif |