shared

Dependencies:   mbed-rtos mbed

Fork of Boboobooo by kao yi

main.cpp

Committer:
Kruskal
Date:
2014-07-01
Revision:
6:132facf9b42d
Parent:
3:c5f2281b3ed2
Child:
7:fe8665daf3e7

File content as of revision 6:132facf9b42d:

#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\n",cam.black_centerR());


       }

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


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

       
         
         
     
     
  #endif   
       
     
     
     
     
     
     
     
     
     
     
     
    
    
    
    
    return 0;
    
    
}