/************************************************************************
* 开放式视觉伺服平台测试程序
* 作者:李智超(西北工业大学)
* 如需转载,请注明出处
* 测试环境为Arduino Uno兼容版
* Originally created 15 June 2013
* Copyleft (c) 2013, Vicent_Lee
* http://blog.youkuaiyun.com/u010305560
*/
#include <Servo.h>
const unsigned int MOTOR_PIN1 = 9;
const unsigned int MOTOR_PIN2 = 10;
const unsigned int MOTOR_DELAY = 15;
const unsigned int SERIAL_DELAY = 5;
const unsigned int BAUD_RATE =19200;//请核对是否与上位机一致
const unsigned int Origin_POS=12;
int xc=1560;
int yc=1590;
int xc_last=1560;
int yc_last=1590;
Servo servo_1,servo_2; // <label id="code.motors.servo"/>
void setup() {
Serial.begin(BAUD_RATE);
servo_1.attach(MOTOR_PIN1); // <label id="code.motors.servo_attach&