/***********************************
功能:小车的移动count为跑到(测试成功)
说明:机器人的移动(将移动函数集成在参数中)
时间:2012.12.12
附录:脉冲数量:3/0.023=130个(3S)
***********************************/
#include<BoeBot.h>
#include<uart.h>
#define LeftMotor P1_1
#define RightMotor P1_0
extern void Forward(int count);
extern void Backward(int count); //count=130次相当于3秒
extern void TurnLeft(int count); //count就是角度 15=90' 32=180'
extern void TurnRight(int count); //count就是角度 15=90
int main()
{ int i;
LeftMotor=0;
RightMotor=0; //伺服电机初始化
for(i=0;i<3;i++)
delay_nms(1000);
Forward(130);
delay_nms(1000);
TurnLeft(32);
delay_nms(1000);
Forward(130);
delay_nms(1000);
while(1);
}