經過這麼多的搜索,我發現我的答案在Pololu web site。 This link顯示了我正在尋找的內容。
這裏是一個A-Star 32U4 Prime LV(Arduino外觀)和一個18通道Micro Maestro伺服控制器的電路圖。我連接了9V輸出適配器而不是電池。
在這裏,來自同一頁的代碼示例;
#include <PololuMaestro.h>
MiniMaestro maestro(Serial1);
void setup()
{
// Set the serial port's baud rate.
Serial1.begin(115200);
}
void loop()
{
/* setTarget takes the channel number you want to control, and
the target position in units of 1/4 microseconds. A typical
RC hobby servo responds to pulses between 1 ms (4000) and 2
ms (8000). */
// Set the target of channel 0 to 1500 us and channel 1 to 1750 us.
maestro.setTarget(0, 6000);
maestro.setTarget(1, 7000);
// Wait 2 seconds.
delay(2000);
// Set the target of channel 0 to 1250 us and channel 1 to 2000 us.
maestro.setTarget(0, 5000);
maestro.setTarget(1, 8000);
// Wait 2 seconds.
delay(2000);
}
感謝您的閱讀。