AIServoFrameRobotis.load()

[AIServo86]

描述

Load the .mtn Frame file generated by RoboPlus Motion Editor.

語法

aiservoframerobotis.load(filename, motionname, step)

參數

  • aiservoframerobotis: Variant of the AIServoFrameRobotis type.
  • filename: The name of the .mtn file generated by the RoboPlus Motion editor. Please note that currently only downloading files from the root of the SD card is supported. If your 86Duino does not have an SD card on it, or if the SD card does not contain the specified file, loading will fail.
  • motionname: the name of the Motion you want to load into the .mtn file.
  • framename: the Step number of the Motion you want to read.

回傳

  • true: File loading successfully.
  • false: File loading failed.

範例

#include <AIServo86.h>
  
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo0;
AIServo myservo1;
AIServo myservo2;
AIServoFrameRobotis myframe;
 
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo0. attach(bus, 9);
   myservo1. attach(bus, 11);
   myservo2. attach(bus, 5);
   // Read Frame 0 of Sequence 0 in the Pololu Frame file
   myframe.load("test.mtn", "abc", 1);
   myframe.playPositions(myservo0, myservo1, myservo2); // play action
}
  
void loop() {}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール