save()

描述

positions[] 陣列的內容儲存至指定的動作幀檔案。

語法


myframe.save(filename)

參數

myframeServoFrame 型別的物件。

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

回傳

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

範例

#include <Servo86.h> 

ServoFrame myframe;
 
void setup() 
{ 
  myframe.positions[0] = 1800; // 設定動作幀內容
  myframe.positions[1] = 1300;
  myframe.positions[2] = 2000;

  myframe.save("frm0.txt"); // 將動作幀儲存為 SD 卡根目錄下的 "frm0.txt"
}
 
void loop() {} 

See also

positions[]
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.