Articles Posted in the " " Category

  • detach()

    detach()

    描述 取消指定该物件的伺服马达信号输出脚位。如果所有 Servo 物件都没有被指定输出讯号的脚位,那么 analogWrite() 将恢复产生 PWM 的功能。 语法 servo.detach() 参数 无参数 回传 无回传值 See also - attach() - attached() 函式库参考主页面 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.


  • attached()

    attached()

    描述 检查该物件是否已经有指定伺服马达信号输出脚位。 语法 servo.attached() 参数 无参数 回传 bool:如果已有指定脚位则回传 true,反之回传 false See also - attach() - 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 are released into the public domain.


  • read()

    read()

    描述 读取最后一次使用 write() 写给伺服马达的角度值。 语法 servo.read() 参数 无参数 回传 int:最后一次 write() 写给伺服马达的角度值 See also - write() 函式库参考主页面 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.


  • writeMicroseconds()

    writeMicroseconds()

    描述 写入值到伺服马达,单位为微秒,藉以控制伺服马达。对标准的伺服马达来说,这个值控制的是角度,当参数为 1000 时,伺服马达会转到逆时钟方向所能到的最大角度,当参数为 2000 时,伺服马达会转到顺时钟方向所能到的最大角度,当参数为 1500 时,伺服马达会转到中点。 有些伺服马达并不依照上述的标准製造,这时必须查看该伺服马达的规格书,才有办法让马达依照我们的想法动作,或是自己实验不同的参数所对应的动作。 如果使用的马达是可以持续旋转的,使用 writeMicrosecond() 的行为模式会与 write() 相似,请参考 write() 的描述。 语法 servo.writeMicroseconds(uS) 参数 uS:用来控制伺服马达的值,单位为微秒 范例 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 […]


  • 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. […]