pixy info2

Dependencies:   CMPS03 SRF05 mbed pixy

Fork of 0000Non_stop_code_v3 by Alexandre Pirotte

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?

UserRevisionLine numberNew contents of line
pirottealex 0:a8cee96c9250 1 #include "mbed.h"
pirottealex 0:a8cee96c9250 2 #include "SRF05.h"
pirottealex 0:a8cee96c9250 3 #include <CMPS03.h>
pirottealex 0:a8cee96c9250 4 char cmdI2C=0xF3 ;// CS vbat x x x SensG SensD CS_G CD_D, sens moteur positif CS à 0.
pirottealex 0:a8cee96c9250 5 PwmOut MotD(p25);
pirottealex 0:a8cee96c9250 6 PwmOut MotG(p22);
pirottealex 0:a8cee96c9250 7
pirottealex 0:a8cee96c9250 8 BusOut leds(LED1,LED2,LED3,LED4);
pirottealex 0:a8cee96c9250 9
pirottealex 0:a8cee96c9250 10 /*DigitalOut trig1(p11);//US1
pirottealex 0:a8cee96c9250 11 InterruptIn echo1(p12);
pirottealex 0:a8cee96c9250 12 DigitalOut trig2(p8);//US2
pirottealex 0:a8cee96c9250 13 InterruptIn echo2(p24);
pirottealex 0:a8cee96c9250 14 DigitalOut trig3(p26);//US3
pirottealex 0:a8cee96c9250 15 InterruptIn echo3(p23);*/
pirottealex 0:a8cee96c9250 16
pirottealex 0:a8cee96c9250 17 SRF05 us_arr(p8,p24);
pirottealex 0:a8cee96c9250 18 CMPS03 Boussole(p9,p10,0xC0);
pirottealex 0:a8cee96c9250 19 I2C monI2C(p9,p10);
pirottealex 0:a8cee96c9250 20 PwmOut Servo(p21);
pirottealex 0:a8cee96c9250 21
pirottealex 0:a8cee96c9250 22 AnalogIn SD_1(p19); // capteur de distance courte droite
pirottealex 0:a8cee96c9250 23 AnalogIn SD_2(p20); // capteur de distance courte gauche
pirottealex 0:a8cee96c9250 24 AnalogIn LD_1(p17); // capteur de distance longue droite
pirottealex 0:a8cee96c9250 25 AnalogIn LD_2(p18); // capteur de distance longue gauche
pirottealex 0:a8cee96c9250 26
pirottealex 0:a8cee96c9250 27 InterruptIn I_D(p30);
pirottealex 0:a8cee96c9250 28 InterruptIn I_G(p29);
pirottealex 0:a8cee96c9250 29
pirottealex 1:99f469d63b9a 30 Timer tempo2;
pirottealex 1:99f469d63b9a 31
pirottealex 0:a8cee96c9250 32 SPI spi(p5,p6,p7);
pirottealex 0:a8cee96c9250 33
pirottealex 0:a8cee96c9250 34 AnalogIn C1(p15);// capteur de ligne blanche 1
pirottealex 0:a8cee96c9250 35 AnalogIn C3(p16);// capteur de ligne blanche 3
pirottealex 0:a8cee96c9250 36 //-- le capteur de ligne 2 est sur un MCP3201(spi) dont le CS est sur p13
pirottealex 0:a8cee96c9250 37
pirottealex 0:a8cee96c9250 38 DigitalIn bp(p14);
pirottealex 0:a8cee96c9250 39 DigitalOut cs(p13);
pirottealex 0:a8cee96c9250 40
pirottealex 0:a8cee96c9250 41
pirottealex 0:a8cee96c9250 42 int j=0,etat=0;
pirottealex 0:a8cee96c9250 43 uint16_t blocks;
pirottealex 0:a8cee96c9250 44 float taille,errorX,gBoussole,cap_set,cap_rot;
pirottealex 1:99f469d63b9a 45 int captL1,bout,flag;
pirottealex 0:a8cee96c9250 46 int captL3;
pirottealex 1:99f469d63b9a 47 float us_arriere,cap_arriere,erreur_ar;
pirottealex 0:a8cee96c9250 48 Timer tempo;