描述
技術規格
4.8v時
速度:0.23 秒/60°
扭力: 3.4 kg·cm
6v時
速度:0.18 秒/60°
扭力: 4公斤/公分
重量:41g
尺寸(單位mm)
尺寸:39.5 x 20.0 x 35.6 mm (長 x寬x高)
接線方式
伺服馬達 的 訊號線(白線) 接至 Arduino D9腳
伺服馬達 的 VCC(紅線) 接至 外部電源5V
伺服馬達 的 GND(黑線) 接至 Arduino GND腳 & 外部電源GND
注意燒錄時將伺服馬達接線移除,否則可能會造成燒錄失敗
程式範例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
/* Sweep by BARRAGAN <http://barraganstudio.com> This example code is in the public domain. modified 8 Nov 2013 by Scott Fitzgerald http://www.arduino.cc/en/Tutorial/Sweep */ #include <Servo.h> Servo myservo; // create servo object to control a servo // twelve servo objects can be created on most boards int pos = 0; // variable to store the servo position void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } } |
參考來源
Arduino內建Library