譯文 張
/
7_7Boboobooo
123
Fork of Boboobooo by
main.cpp
- Committer:
- physicsgood
- Date:
- 2014-07-07
- Revision:
- 6:b046d6ff3745
- Parent:
- 3:c5f2281b3ed2
- Child:
- 7:f04bde0ca846
File content as of revision 6:b046d6ff3745:
#include "mbed.h" #include "servo_api.h" #include "camera_api.h" #include "motor_api.h" #define Debug_cam_uart //middle 0.041 Serial pc(USBTX, USBRX); BX_servo servo; BX_camera cam; BX_motor MotorA('A'); BX_motor MotorB('B'); int main() { /* int black_va; int white_va; */ double Kp = 0.0; #ifdef Debug_cam_uart pc.baud(115200); while(1){ cam.read(); MotorA.rotate(0.0); MotorB.rotate(0.0); servo.set_angle(0.051); /*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("ang :%d\r\n ",( (64.0-center) /64.0 )*90); //-------------------------------------------- // servo.set_angle(( (64.0-center) /64.0 )*90 ); #endif return 0; }