5
商品编码 [ 24745480776 ]











-------------------------------------------------------------------------------------------------------------------
控制代码示例:
// Sweep
#include
Servo myservoA; // create servo object to control a servo
Servo myservoB;
Servo myservoC;
Servo myservoD;
int pos = 20; // variable to store the servo position
void setup()
{
myservoA.attach(9); // attaches the servo on pin 9,10,11,6 to the servo object
myservoB.attach(10);
myservoC.attach(11);
myservoD.attach(6);
}
void loop()
{
for(pos = 0; pos <=1000; pos += 1)
{
myservoB.write(int(map(pos,1,1000,65,30))); // tell servo to go to position in variable 'pos'
myservoC.write(int(map(pos,1,1000,50,70)));
delay(1);
}
delay(1000);
for(pos = 0; pos < 500; pos += 1)
{
myservoB.write(map(pos,1,500,30,65));
myservoC.write(map(pos,1,500,70,50));
myservoA.write(70);
delay(1);
}
for(pos = 0; pos < 500; pos += 1)
{
myservoA.write(map(pos,1,500,70,150));
myservoD.write(map(pos,1,500,0,180));
delay(1); // waits 1ms*500 for the servo to reach the position
}
for(pos = 0; pos < 1000; pos += 1)
{
myservoB.write(map(pos,1,1000,65,30));
myservoC.write(map(pos,1,1000,50,70));
delay(1);
}
delay(1000);
for(pos = 0; pos <=1000; pos += 1)
{
myservoB.write(map(pos,1,1000,30,65));
myservoC.write(map(pos,1,1000,70,50));
delay(1);
}
for(pos = 0; pos<=1000; pos += 1)
{
myservoA.write(map(pos,1,1000,150,70));
myservoD.write(map(pos,1,1000,180,0));
delay(1);
}
}
-------------------------------------------------------------------------------------------------------------------
Arduino软件官方下载地址:http://picimg.lshou.com/pic/arduino.cc/en/Main/Software
-------------------------------------------------------------------------------------------------------------------
渠道代理请743 陈先生
-------------------------------------------------------------------------------------------------------------------
[tyt] duSrgGF4YIBoHAbwVYudLbAvT1pUmdt9KL7sYlNbDA+QMzwNw5MezJSZAE+KBVMnzvISMkcblxNSizLMknEHCCDSNkc= [/tyt]