pixy info2
Dependencies: CMPS03 SRF05 mbed pixy
Fork of 0000Non_stop_code_v3 by
fct.h@1:99f469d63b9a, 2017-06-10 (annotated)
- Committer:
- pirottealex
- Date:
- Sat Jun 10 07:20:21 2017 +0000
- Revision:
- 1:99f469d63b9a
- Parent:
- 0:a8cee96c9250
- Child:
- 2:48f7e5f79caa
llllllllllllllllllllllllllll;
Who changed what in which revision?
User | Revision | Line number | New 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; |
pirottealex | 1:99f469d63b9a | 10 | extern float us_arriere,gBoussole,cap_set,erreur_ar,flag; |
pirottealex | 0:a8cee96c9250 | 11 | extern int j,etat,bout; |
pirottealex | 0:a8cee96c9250 | 12 | extern uint16_t blocks; |
pirottealex | 1:99f469d63b9a | 13 | extern float taille,errorX,cap_rot,cap_arriere; |
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; |
pirottealex | 0:a8cee96c9250 | 27 | extern I2C monI2C; |
pirottealex | 0:a8cee96c9250 | 28 | extern DigitalOut cs; |
pirottealex | 0:a8cee96c9250 | 29 | extern PwmOut Servo; |
pirottealex | 0:a8cee96c9250 | 30 | extern DigitalIn bp; |
pirottealex | 0:a8cee96c9250 | 31 | extern AnalogIn SD_1; // capteur de distance courte droite |
pirottealex | 0:a8cee96c9250 | 32 | extern AnalogIn SD_2; // capteur de distance courte gauche |
pirottealex | 0:a8cee96c9250 | 33 | extern AnalogIn LD_1; // capteur de distance longue droite |
pirottealex | 0:a8cee96c9250 | 34 | extern AnalogIn LD_2; // capteur de distance longue gauche |
pirottealex | 0:a8cee96c9250 | 35 | extern CMPS03 Boussole; |
pirottealex | 0:a8cee96c9250 | 36 | extern InterruptIn I_D; |
pirottealex | 0:a8cee96c9250 | 37 | extern InterruptIn I_G; |
pirottealex | 0:a8cee96c9250 | 38 | |
pirottealex | 0:a8cee96c9250 | 39 | extern SPI spi; |
pirottealex | 0:a8cee96c9250 | 40 | |
pirottealex | 0:a8cee96c9250 | 41 | extern AnalogIn C1;// capteur de ligne blanche 1 |
pirottealex | 0:a8cee96c9250 | 42 | extern AnalogIn C3;// capteur de ligne blanche 3 |
pirottealex | 0:a8cee96c9250 | 43 | //-- le capteur de ligne 2 est sur un MCP3201(spi) dont le CS est sur p13 |
pirottealex | 0:a8cee96c9250 | 44 | extern DigitalOut cs; |
pirottealex | 0:a8cee96c9250 | 45 | |
pirottealex | 0:a8cee96c9250 | 46 | |
pirottealex | 0:a8cee96c9250 | 47 | |
pirottealex | 0:a8cee96c9250 | 48 | //CONSTANTES |
pirottealex | 0:a8cee96c9250 | 49 | #define ADR_PCF 0x70 |
pirottealex | 0:a8cee96c9250 | 50 | #define PERIOD 0.0001 |
pirottealex | 0:a8cee96c9250 | 51 | #define V_max 30 |
pirottealex | 0:a8cee96c9250 | 52 | #define V_recherche 18 |
pirottealex | 0:a8cee96c9250 | 53 | #define K 0.1 |
pirottealex | 0:a8cee96c9250 | 54 | #define V_moy 25 |
pirottealex | 0:a8cee96c9250 | 55 | |
pirottealex | 0:a8cee96c9250 | 56 | //PROTOTYPES |
pirottealex | 0:a8cee96c9250 | 57 | void lecture_blanc(void); |
pirottealex | 0:a8cee96c9250 | 58 | void vitmoteur(float,float); |
pirottealex | 0:a8cee96c9250 | 59 | void lecture_us(void); |
pirottealex | 0:a8cee96c9250 | 60 | void init(void); |
pirottealex | 0:a8cee96c9250 | 61 | void lecture_boussole(void); |
pirottealex | 0:a8cee96c9250 | 62 | #endif |