save()

Description

Saves the contents of the offsets[] array as a servo offset fine-tuning value file that can be loaded by the ServoFrame.

Syntax

myoffset.save(filename)

Parameters

myoffset: An object of type ServoOffsetVstone.

filename: The specified file name. Note: The file will be saved to the root directory of the SD card. If there is no SD card inserted in your 86Duino, the save will fail.

Return

true: The file was saved successfully.

false: The file failed to be saved.

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

#include <Servo86.h>

 

ServoOffsetVstone myoffset;

 

void setup()

{

  myoffset.offsets[0] = -200; // Set servo offset fine-tuning value

  myoffset.offsets[1] = 50;

  myoffset.offsets[2] = -100;

 

  myoffset.save("offsets.txt"); // Save the offset fine-tuning value to "offsets.txt" in the SD card's root directory.

}

 

void loop() {}

See also

- offsets[]
- load()


Library reference main page

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.