# MG90S 伺服馬達  ## 基礎小知識 >### MG90S 伺服馬達 > * 相較 SG90 , 採用金屬齒輪,規格更好 > * 棕色:GND > * 紅色:VCC (4.8-7.2V) > * 橘色:PWM脈衝輸入 > >技術規格 > >重量:13.6g 尺寸:22.8 * 12.2 * 28.5mm 扭力:2.0kg/cm (4.8V), 2.2kg/cm (6.0V) 速度:0.1s/60° (4.8V) 轉動角度:0° - 180° 齒輪形式:金屬齒輪 工作電壓:4.8-6V 工作溫度: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
.