sd.write()
sd.write(filename,data)
Write to a file on the SD Card
Easily write your string to a file on the SD card.
If the file does not exist it will be automatically created, if it already exists it will be overwritten.
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| filename | string | yes | — | e.g. "config.json" |
| data | string | yes | — | Data to write to the file |
Returns
number
0 = no error, >0 = error code
Example
sd.write("hello.txt","Hello World!");