2015-04-06 90 views
-2

我是Arduino和(更新的)micro maestro伺服控制器的新手。我不能一起使用它們。我在互聯網上搜索了很多東西,但是找不到對電子產品完全陌生的人的信息。Arduino Uno with Micro Maestro 24-ch伺服控制器教程

我需要一個超級基本代碼和接線示例,用於控制具有微型大師24通道伺服控制器的1臺伺服電機。 我可以通過USB連接使用Pololu軟件。但是我想從Arduino Uno發送命令,而無需將伺服控制器連接到PC。 我有以下物品;

  • Arduino的烏諾
  • Pololu微大師24通道伺服控制器
  • 甲微伺服
  • 9V功率伺服控制器(我不知道在哪裏插入)
  • 跳線電纜

請解釋如何做伺服90度(和設置速度,加速度等)。接線和編碼。

然後,我會在這裏爲解決搜索信息的人員提供圖片解決方案。

感謝您的閱讀。

回答

1

經過這麼多的搜索,我發現我的答案在Pololu web siteThis link顯示了我正在尋找的內容。

這裏是一個A-Star 32U4 Prime LV(Arduino外觀)和一個18通道Micro Maestro伺服控制器的電路圖。我連接了9V輸出適配器而不是電池。

enter image description here

在這裏,來自同一頁的代碼示例;

#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); 
} 

感謝您的閱讀。