good

Dependencies:   mbed

Fork of BX-car by Clark Lin

main.cpp

Committer:
backman
Date:
2014-06-04
Revision:
3:c5f2281b3ed2
Parent:
2:c51647d3c14d
Child:
6:5a39bde2e016

File content as of revision 3:c5f2281b3ed2:

#include "mbed.h"
#include "servo_api.h"
#include "camera_api.h"


#define Debug_cam_uart


Serial pc(USBTX, USBRX);
BX_servo servo; 
 
    BX_camera cam;



int main() {
    
  /*  
    int black_va;
    int white_va;
    */
    
#ifdef Debug_cam_uart
     pc.baud(115200);
     
     
  while(1){   
     
      cam.read();
         
        for(int i=0;i<128;i++){
             if(i==64)
               pc.printf("X");
             else          
               pc.printf("%c", cam.sign_line_imageL[i]);
         }
         pc.printf("           ||             ");
         
         for(int i=0;i<128;i++){
             if(i==64)
               pc.printf("X");
             else          
               pc.printf("%c", cam.sign_line_imageR[i]);
         }
         pc.printf("\r\n");
     


        pc.printf("R center : %d  \r\nL center: %d\r\n",cam.black_centerR(),cam.black_centerL());


       }

     
     
     
     
     
     
     
        //   pc.printf("ang :%d\r\n ",( (64.0-center) /64.0  )*90);
   //--------------------------------------------            


         // servo.set_angle(( (64.0-center) /64.0  )*90 );

       
         
         
     
     
  #endif   
       
     
     
     
     
     
     
     
     
     
     
     
    
    
    
    
    return 0;
    
    
}