看板 ASM 關於我們 聯絡資訊
大家好 我最近遇到一些問題 上來請教高手幫忙解決 我要將伺服馬達MG995旋轉至指定角度 我是在拍賣上買了一顆號稱可以360度旋轉的MG995 但是我在使用Arduino uno操控他時發現他一直轉動 code是使用arduino官方的sample code做一點小改動 ----------- void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there } ----------- 我挖底層的.cpp跟.h 看起來val<180內都會是指定角度 val>180時則會變成時間 -->myservo.write(255); 則會變成執行255 unit time 一直無法解決這個問題 希望有高手能解答 另外, 我懷疑MG995根本無法做到我想要功能... 有人好像用SG90可以做到指定角度 code我照做也無法 如果MG995無法實現我功能的話, 能提供出相同"大小"的伺服馬達嗎 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.223.131 ※ 文章網址: https://www.ptt.cc/bbs/ASM/M.1450274350.A.C8B.html
dysyase: 應該不是MG149的問題,https://goo.gl/HMHzaj 12/17 11:31
smtmike: 慢慢挑有各種角度的4320 2160 1080 960 360 度的 好多種 12/19 04:53
swift2: 網站上幾乎都是在說扭力跟速度...有在說明可指定角度? 12/19 16:48
smtmike: 應該是不熟悉用法,站內信討論吧 12/20 16:35