save()

描述

offsets[] 陣列的內容儲存為可被 ServoFrame 載入的伺服機偏移量微調值檔案。

語法


myoffset.save(filename)

參數

myoffsetServoOffsetVstone 型別的物件。

filename:指定的檔案名稱。注意:檔案會儲存至 SD 卡的根目錄下,假如您的 86Duino 沒有插入 SD 卡,則儲存會失敗。

回傳

true:檔案儲存成功。
false:檔案儲存失敗。

範例

#include <Servo86.h> 

ServoOffsetVstone myoffset;

void setup() 
{ 
  myoffset.offsets[0] = -200; // 設定伺服機偏移量微調數值
  myoffset.offsets[1] = 50;
  myoffset.offsets[2] = -100;

  myoffset.save("offsets.txt"); // 將偏移量微調值儲存至 SD 卡根目錄下的 "offsets.txt"
} 

void loop() {} 

See also

offsets[]
load()


函式庫參考主頁面

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.