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.