# MG996R 伺服馬達  ## 基礎小知識 > ### MG996R 伺服馬達 > * 扭力高,故常被用於製作機械手臂與雙足機器人上 > * 棕色:GND > * 紅色:VCC (4.8-7.2V) > * 橘色:PWM脈衝輸入 > > 技術規格 > > 重量:55g 尺寸:40.7 * 19.7 * 42.9mm 扭力:9.4kg/cm (4.8V), 11kg/cm (6.0V) 速度:0.17s/60° (4.8V) 0.14s/60° (6V) 轉動角度:0° - 180° 齒輪形式:金屬齒輪 工作電壓:4.8-7.2V 工作溫度:0° - 55° 工作死區:5us (微秒) ## 簡單實作 ### 接線圖  >棕色 -- GND >紅色 -- 5V >橘色 -- Pin 9 ### 程式碼 ``` c = #include <Servo.h> //載入函式庫,這是內建的,不用安裝 Servo myservo; // 建立SERVO物件 void setup() { myservo.attach(9); // 設定要將伺服馬達接到哪一個PIN腳 } void loop() { myservo.write(0); //旋轉到0度,就是一般所說的歸零 delay(1000); myservo.write(90); //旋轉到90度 delay(1000); myservo.write(180); //旋轉到180度 delay(1000); myservo.write(90); delay(1000); } ```
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.