7Robot_Freescale / Mbed 2 deprecated freescal_cup_k22f

Dependencies:   mbed freescal_cup_k22f

Dependents:   freescal_cup_k22f

Committer:
RobinN7
Date:
Wed Jan 21 16:54:53 2015 +0000
Revision:
26:a836e62e0c98
Parent:
25:f9d3d30cbb5d
Child:
27:d1da489fc79a
pp;

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