7Robot_Freescale / Mbed 2 deprecated freescal_cup_k22f

Dependencies:   mbed freescal_cup_k22f

Dependents:   freescal_cup_k22f

Committer:
RobinN7
Date:
Wed Jan 21 17:34:38 2015 +0000
Revision:
27:d1da489fc79a
Parent:
26:a836e62e0c98
Child:
28:c9d882501013
bitch

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RobinN7 0:3af30bfbc3e5 1
RobinN7 0:3af30bfbc3e5 2 //Bibliothéque
RobinN7 0:3af30bfbc3e5 3 #include "mbed.h"
RobinN7 0:3af30bfbc3e5 4 #include "QEI.h"
RobinN7 0:3af30bfbc3e5 5 #include "Gestion_Moteur.h"
RobinN7 0:3af30bfbc3e5 6 #include "Camera.h"
RobinN7 0:3af30bfbc3e5 7 #include "Servo.h"
RobinN7 0:3af30bfbc3e5 8
RobinN7 27:d1da489fc79a 9
RobinN7 0:3af30bfbc3e5 10 //Differents objet/variable global
RobinN7 0:3af30bfbc3e5 11
RobinN7 27:d1da489fc79a 12 //Xbee
RobinN7 27:d1da489fc79a 13 Serial uart(PTD3, PTD2);
RobinN7 27:d1da489fc79a 14
AlexandreN7 1:49100fa5e278 15 //test de commit
RobinN7 14:000be67805b2 16 //Serial uart(USBTX, USBRX); //port série usb ACM0
RobinN7 26:a836e62e0c98 17
AlexandreN7 9:43c8e6d6724d 18 AnalogIn pot1(PTC1);
RobinN7 0:3af30bfbc3e5 19
RobinN7 0:3af30bfbc3e5 20 int main() {
RobinN7 0:3af30bfbc3e5 21 // Initialisation
RobinN7 0:3af30bfbc3e5 22
RobinN7 26:a836e62e0c98 23 //float Kp_servo = 0;
RobinN7 0:3af30bfbc3e5 24 init_led();
RobinN7 26:a836e62e0c98 25 init_camera();
RobinN7 0:3af30bfbc3e5 26
RobinN7 27:d1da489fc79a 27 int compteur_uart=0;
RobinN7 27:d1da489fc79a 28
RobinN7 0:3af30bfbc3e5 29 // Init UART baudrate
RobinN7 27:d1da489fc79a 30 uart.baud(115200);
RobinN7 0:3af30bfbc3e5 31
RobinN7 0:3af30bfbc3e5 32
RobinN7 0:3af30bfbc3e5 33 // Lancement boucle
RobinN7 0:3af30bfbc3e5 34 while(1){
RobinN7 26:a836e62e0c98 35
RobinN7 27:d1da489fc79a 36 if (flag_new_image==1)
RobinN7 27:d1da489fc79a 37 {
RobinN7 27:d1da489fc79a 38 if (compteur_uart ==20) // on envoit une trame toute les 50 acquisitions de cameras
RobinN7 26:a836e62e0c98 39 {
RobinN7 26:a836e62e0c98 40 uart.printf("S1");//debug START
RobinN7 27:d1da489fc79a 41 for (int indice_pixel=0; indice_pixel<128; indice_pixel++)
RobinN7 26:a836e62e0c98 42 {
RobinN7 26:a836e62e0c98 43 uart.printf("%d,",pixel1[indice_pixel]);
RobinN7 26:a836e62e0c98 44 }
RobinN7 26:a836e62e0c98 45 uart.printf("E");//debug END
RobinN7 27:d1da489fc79a 46
RobinN7 26:a836e62e0c98 47 uart.printf("S2");//debug START
RobinN7 27:d1da489fc79a 48 for (int indice_pixel=0; indice_pixel<128; indice_pixel++)
RobinN7 26:a836e62e0c98 49 {
RobinN7 26:a836e62e0c98 50 uart.printf("%d,",pixel2[indice_pixel]);
RobinN7 26:a836e62e0c98 51 }
RobinN7 26:a836e62e0c98 52 uart.printf("E");//debug END
RobinN7 26:a836e62e0c98 53 compteur_uart =0;
AlexandreN7 20:24ebe046ebe9 54 }
RobinN7 27:d1da489fc79a 55 else
RobinN7 27:d1da489fc79a 56 {
RobinN7 26:a836e62e0c98 57 compteur_uart =compteur_uart+1;
RobinN7 27:d1da489fc79a 58 }
AlexandreN7 20:24ebe046ebe9 59 }
RobinN7 27:d1da489fc79a 60 // uart.printf("0,%d,%d\n\r",max_detect1,max_detect2);
RobinN7 27:d1da489fc79a 61 flag_new_image=0;
RobinN7 27:d1da489fc79a 62
RobinN7 0:3af30bfbc3e5 63 }
RobinN7 0:3af30bfbc3e5 64 }
RobinN7 0:3af30bfbc3e5 65