集团标准化小组:[VVOPPT-JOPP28-JPPTL98-LOPPNN]
机械臂控制代码
##include <>
#include <>
#include <>
AxisY();
c=();
z=();
}
if(x==255&& y>120 && y<140&& c == 0 && z==1)//一号舵机
{ pos1 = pos1+10;
(pos1);
delay (40);
if(pos1>160)
{
pos1=160;
(pos1);
}
}
else if(x==255 && y>120 && y<140 && z==0 && c==1 )
{ pos1 = pos1-10;
(pos1);
delay(40);
if(pos1<20)
{
pos1=20;
(pos1);
}
}
else if(x>220&& y==0&& c == 0 && z==1) //2号舵机
{
pos2 = pos2+10;
(pos2);
delay (40);
if(pos2>160)
{
pos2=160;
(pos2);
}
}
else if(x>220 && y==0&& z==0 && c==1 )
{
pos2 = pos2-10;
(pos2);
delay(40);
if(pos2<90)
{
pos2=90;
(pos2);
}
}
else if(x>110&& x<140&& y==0&& c == 0 && z==1) //3号舵机
{
pos3 = pos3+10;
(pos3);
delay (40);
if(pos3>160)
{
pos3=160;
(pos3);
}
}
else if(x>110&& x<140&& y==0&& z==0 && c==1 )
{
pos3 = pos3-10;
(pos3);
delay(40);
if(pos3<20)
{
pos3=20;
(pos3);
}
}
else if(x==0&& y==0&& c == 0 && z==1) //4号舵机
{
pos4 = pos4+10;
(pos4);
delay (40);
if(pos4>160)
{
pos4=160;
(pos4);
}
}
else if(x==0 && y==0&& z==0 && c==1 )
{
pos4 = pos4-10;
(pos4);
delay(40);
if(pos4<20)
{
pos4=20;
(pos4);
}
}
else if(x==0&& y==128&& c == 0 && z==1) //5号舵机
{
(pos5);
pos5 = pos5+10;
delay (40);
if(pos5>170)
{
pos5=160;
}
}
else if(x==0 && y==128&& z==0 && c==1 )
{
(pos5);
pos5 = pos5-10;
delay(40);
if(pos5<20)
{
pos5=30;
}
}
else if(x==0 && y>240&& c == 0 && z==1) //6号舵机
{
(pos6);
pos6 = pos6+10;
delay (40);
if(pos6>120)
{
pos6=119;
}
}
else if(x==
机械臂控制代码 来自淘豆网m.daumloan.com转载请标明出处.