ServoOffsetVstone.load()

[Servo86]

描述

In the .ini action settings file generated by RobovieMaker2, load the specified servo offset fine tuning values.

語法

myoffset.load(filename, offset_name)

參數

  • myoffset: The ServoOffsetVstone type of object.
  • filename: The name of the .ini action profile generated by RobovieMaker2. Note: This function only looks for the specified file in the root directory of the SD card. If your 86Duino does not have an SD card inserted, or if the SD card does not contain the specified file, loading will fail.
  • offset_name: The name of the Offset in the RobovieMaker2 action profile (available in RobovieMaker2).

回傳

  • true: The file was loaded successfully.
  • false: File loading failed.

範例

#include <Servo86.h>
 
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoOffsetVstone myoffset;
 
void setup()
{
   myservo0.attach(9);
   myservo1.attach(11);
   myservo2.attach(5);
 
   // Load the offset trim value named Offset 0 from the vstone_offset.ini profile in the SD card
   myoffset.load("vstone_offset.ini", "Offset 0");
 
   myoffset.setOffsets(myservo0, myservo1, myservo2); // Set the offset fine-tuning value of each servo
}
 
void loop() {}

參考


函式庫參考主頁面

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

發表評論

上部へスクロール