Articles Posted by the Author:

  • write()

    write()

    描述 写入值到伺服马达,藉以控制伺服马达。对标准的伺服马达来说,不同的参数代表不同的角度,呼叫完 write() 后伺服马达将会转到对应的角度。如果使用的马达是可以持续旋转的,参数为 0 时马达会全速往某个方向转动,参数为 180 时会全速往另一个方向转动,参数为 90 时马达不会转动。 语法 servo.write(angle) 参数 angle:用来控制伺服马达的值,该值的范围从 0 ~ 180 范例 See also - attach() - read() 函式库参考主页面 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 […]


  • attach()

    attach()

    描述 指定该物件的伺服马达信号输出脚位。 语法 servo.attach(pin) servo.attach(pin, min, max) 参数 pin:要指定给物件的脚位编号 min(非必要):指定伺服马达角度为 0 度时对应的脉波宽度,单位为微秒,预设为 544 微秒 max(非必要):指定伺服马达角度为 180 度时对应的脉波宽度,单位为微秒,预设为 2400 微秒 范例 See also - attached() - detach() 函式库参考主页面 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 […]


  • rewindDirectory()

    rewindDirectory()

    描述 回到资料夹的第一个档案。 语法 file.rewindDirectory() 参数 file被 SD.open() 回传的 File 物件 回传 无回传值 范例 See Also - open() - openNextFile() - isDirectory() 函式库参考主页面 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 […]


  • openNextFile()

    openNextFile()

    描述 开启下一个档案或是资料夹。 语法 file.openNextFile() 参数 file:被 SD.open() 回传的 File 物件 回传 File:如果档案开启成功回传一个指向该档案的 File 物件,如果开启失败则该 File 物件在使用 if 判断时与布林值的 false 相等 范例 See Also - isDirectory() - rewindDirectory() 函式库参考主页面 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 […]


  • isDirectory()

    isDirectory()

    描述 判断 File 物件所开启的是否是资料夹。 语法 file.isDirectory() 参数 file:被 SD.open() 回传的 File 物件 回传 bool:如果 File 物件所开启的是资料夹则回传 true,反之则回传 false 范例 See Also - openNextFile() - rewindDirectory() 函式库参考主页面 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 […]


  • write()

    write()

    描述 写入资料至档案。 语法 file.write(data) file.write(buf, len) 参数 file:被 SD.open() 回传的 File 物件 data:要写入的资料,型态可以为 byte、char 或 char* buf:存放写入资料的字元阵列 len:buf 的大小 回传 byte:回传 write() 写入至档案的位元组数量 See Also - print() - println() - read() 函式库参考主页面 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. […]


  • read()

    read()

    描述 从档案读取资料。 read() 是从 Stream 继承而来。 语法 file.read() 参数 file:被 SD.open() 回传的 File 物件 回传 byte:回传档案未读资料中最前面的字元,如果没有未读资料可以读回传 -1 See Also - available() - peek() - write() - Stream.read() 函式库参考主页面 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 […]


  • size()

    size()

    描述 取得档案的大小。 语法 file.size() 参数 file:被 SD.open() 回传的 File 物件 回传 unsigned long:档案的大小,单位为位元组 函式库参考主页面 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.


  • seek()

    seek()

    描述 移动读取及写入资料到档案的位置。 语法 file.seek(pos) 参数 file:被 SD.open() 回传的 File 物件 pos:要移动到的目标位置,型态为 unsigned long 回传 bool:执行成功则回传 true,反之回传 false See Also - position() 函式库参考主页面 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 […]


  • println()

    println()

    描述 写入资料到 MicroSD 卡裡的档案,在资料写入完成后再写入一个换行字元(’\n’)到档案,该档案必须是以写入模式打开。当要传送的资料为数字时,每一位数会被拆开来并各自被当作字元(例:如果要送的资料为 123 ,print() 会把 123 当作 ‘1’, ‘2’, ‘3’ 三个字元)。 语法 file.println() file.println(data) file.print(data, BASE) 参数 file:被 SD.open() 回传的 File 物件 data:要传送的资料,型态可以为 char, byte, int, long 或 string BASE(非必要):BASE 用来指定资料的格式;可用的格式有:BIN(二进位格式)、OCT(八进位格式)、DEC(十进位格式)、HEX(十六进位格式) 回传 byte:回传 println() 写入至档案的位元组数量 See Also - print() - write() 函式库参考主页面 The text of the 86Duino reference is a modification of the […]