我想找...

搜尋

分享

目錄

AIServoOffset constructor

[AIServo86]

描述

Initializes the AIServoOffset class.

語法

AIServoOffset myoffset
AIServoOffset myoffset(filename)

參數

filename: The file name.
When a file name is specified, the specified servo trim value file will be loaded during the initialization of the ServoOffset category. Please note that currently, only files from the root directory of the SD card are supported. If your 86Duino is not equipped with an SD card, or if the SD card does not contain the specified file, loading will fail.

範例

#include <AIServo86.h>
 
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo1;
AIServo myservo2;
AIServo myservo3;
AIServoOffset myoffset("offset.txt"); // Load the servo offset value file named offset.txt from the SD card
 
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo1. attach(bus, 1);
   myservo2. attach(bus, 3);
   myservo3. attach(bus, 5);
 
   myoffset. setOffsets();
   myservo1. setPosition(100);
   myservo2.setPosition(150);
   myservo3.setPosition(200);
   aiservoMultiRun();
}
 
void loop() {}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。

返回頂端