描述 写入资料到 MicroSD 卡裡的档案,该档案必须是以写入模式打开。当要传送的资料为数字时,每一位数会被拆开来并各自被当作字元(例:如果要送的资料为 123 ,print() 会把 123 当作 ‘1’, ‘2’, ‘3’ 三个字元)。 语法 file.print(data) file.print(data, BASE) 参数 file:被 SD.open() 回传的 File 物件 data:要传送的资料,型态可以为 char, byte, int, long 或 string BASE(非必要):BASE 用来指定资料的格式;可用的格式有:BIN(二进位格式)、OCT(八进位格式)、DEC(十进位格式)、HEX(十六进位格式) 回传 byte:回传 print() 写入至档案的位元组数量 See Also - println() - write() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino […]
描述 取得档案现在的位置,该位置标记下一次读取或写入的位置。 语法 file.position() 参数 file:被 SD.open() 回传的 File 物件 回传 unsigned long:目前档案的位置 See Also - seek() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
以下以一系列的连续图示,说明把 86Duino 开发板插上 Windows 8 电脑后,安装 86Duino 驱动程式的步骤。 (回到 在 Windows 下使用 86Duino 页面。) Getting-Started Home The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
描述 回传档案未读资料中的第一个字元,回传后不把该字元认为是已读。由于没有把回传的字元认为是已读,所以如果没有呼叫 read() 每次呼叫 peek() 都会得到同一个字元。 peek() 是从 Stream 继承而来。 语法 file.peek() 参数 file:被 SD.open() 回传的 File 物件 回传 int:回传档案未读资料中最前面的字元,如果没有未读资料可以读回传 -1 See Also - available() - read() - write() - Stream.peek() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. […]
描述 把对档案的修改实际写入 MicroSD 卡,这个动作在关闭档案时会自动执行。 read() 是从 Stream 继承而来。 语法 file.flush() 参数 file:被 SD.open() 回传的 File 物件 回传 无回传值 See Also - close() - Stream.flush() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released […]
描述 关闭档案并且确保对档案的修改储存至 MicroSD 卡。 语法 file.close() 参数 file:被 SD.open() 回传的 File 物件 回传 无回传值 See Also - SD: open() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 检查档案是否还有可读取的资料。 available() 是从 Stream 继承而来。 语法 file.available() 参数 file:被 SD.open() 回传的 File 物件 回传 int:可读资料的位元组数量 See Also - read() - peek() - Stream.available() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released […]
描述 删除 MicroSD 卡裡的资料夹,该资料夹必须是空的。 语法 SD.rmdir(dir_name) 参数 dir_name:要删除的资料夹路径,路径应该要以 “/” 分隔资料夹名称 回传 bool:如果资料夹成功删除则回传 true,反之则回传 false,如果要删除的资料夹不存在,回传的值可能是任何值 See also - mkdir() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 删除 MicroSD 卡裡的档案。 语法 SD.remove(filename) 参数 filename:要删除的档案路径,路径应该要以 “/” 分隔资料夹名称 回传 bool:如果档案成功删除则回传 true,反之则回传 false,如果要删除的档案不存在,回传的值可能是任何值 See also - rmdir() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 开启 MicroSD 卡上的档案。如果档案开启的模式是写入,而指定的档案不存在,则会建立该档案,但是存放该档案的资料夹必须已经存在。 语法 SD.open(filepath) SD.open(filepath, mode) 参数 filename:要开启的资料夹路径,路径应该要以 “/” 分隔资料夹名称,型态为 char* mode (非必要):开启档案的模式,可以为以下之一,如果没有提供这个参数,预设为 FILE_READ FILE_READ:开启档案后可以读取资料,起始位址为档案的开头 FILE_WRITE:开启档案后可以写入以及读取资料,起始位址为档案的结尾 回传 File:如果档案开启成功回传一个指向该档案的 File 物件,如果开启失败则该 File 物件在使用 if 判断时与布林值的 false 相等 See also - File: close() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike […]