描述 使暂停中的伺服机继续转动。 语法 servo.resume() 参数 servo:Servo 型别的变数。 回传 范例 See also - setPosition() - run() - pause() 函式库参考主页面 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.
描述 暂停伺服机的转动。 请注意,暂停后的伺服机仍会出力,请勿用手大力转动,否则容易造成伺服机损坏。若要使暂停的伺服机继续转动,请呼叫 resume()。 语法 servo.pause() 参数 servo:Servo 型别的变数。 回传 范例 See also - setPosition() - run() - resume() 函式库参考主页面 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.
描述 命令伺服机转动至 setPosition() 设定的目标位置。 呼叫 run() 后,您的程式可以去做其他事情,转动伺服机的工作会在背景执行,如果想知道伺服机是否转到目标位置,可以呼叫 isMoving() 或 isServoMultiMoving() 来检查。 请注意,当伺服机处于脱力状态时,此函式将会让伺服机立即出力,此时请避免以手大力转动伺服机,以免受伤或使伺服机损坏。 语法 servo.run() 参数 servo:Servo 型别的变数。 回传 范例 See also - setVelocity() - setPosition() 函式库参考主页面 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.
描述 读取伺服机目前角度。 语法 servo.readMicroseconds() 参数 servo:Servo 型别的变数。 回传 伺服机目前的角度(型别为 unsigned long 整数),如果伺服机尚未出力,回传值为 0。(单位:us) 范例 See also - write() - writeMicroseconds() - 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 into the […]
描述 设定伺服机目标角度,并且让伺服机转动至目标角度。 请注意,呼叫此函式后会让伺服机立即出力,请避免以手大力转动伺服机,以免受伤或损坏伺服机。 语法 servo.writeMicroseconds(position) 参数 servo:Servo 型别的变数。 position:目标角度,单位:us。 回传 范例 See also - write() - read() - readMicroseconds() - setVelocity() 函式库参考主页面 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 […]
描述 设定呼叫 run() 时,伺服机的目标位置。 语法 servo.setPosition(position) servo.setPosition(position, time) 参数 servo:Servo 型别的变数。 position:伺服机目标位置,可输入整数和浮点数型别的数值。当输入整数时,目标位置的单位是 us,例如输入 1500,代表对应 PWM 脉波为 1500us 的伺服机位置。当输入的是符点数时,目标位置的单位是度,例如输入 90.0,代表伺服机的 90 度位置。 time(可选):指定伺服机从当前位置转动到目标位置的期望花费时间。若输入值为 0,则伺服机将会以最快速度转动;若没有输入值,则伺服机将会根据 setVelocity() 设定的速度转动。 回传 范例 See also - setVelocity() - run() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference […]
描述 设定下一次呼叫 write() 及 run() 时,伺服机的转动速度。 请注意,若您呼叫 setPosition() 时设定了转动时间,则此函式设定的转速将不会有效果。 语法 servo.setVelocity(value) 参数 servo:Servo 型别的变数。 value:伺服机的转速,可输入整数和浮点数型别的数值。当输入整数时,转速的单位是 us/s,例如输入 1000,代表即每秒转 1000us 的角度。当输入的是浮点数时,转速的单位是角度/s,例如输入 1.5,代表即每秒转 1.5 度。若输入值为 0 或 0.0,代表伺服机将会以最快的速度转动。 回传 范例 See also - write() - writeMicroseconds() - setPosition() - run() 函式库参考主页面 The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code […]
描述 将伺服机的最大脉波宽度和最小脉波宽度对应到使用者自定义的角度。 在呼叫 attach() 后,预设会将的最小脉波宽度和最大脉波宽度分别对应到 0 度与 180 度,您可呼叫此函式改变对应的角度。 语法 servo.angleMap(min, max) 参数 servo:Servo 型别的变数。 min:伺服机最小脉波宽度要对应到的角度,值以浮点数表示,范围介于 0.0 ~ 360.0 之间,单位:度。 max:伺服机最大脉波宽度要对应到的角度,值以浮点数表示,范围介于 0.0 ~ 360.0 之间,单位:度。 回传 范例 See also - attach() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 […]
描述 设定伺服机目标角度,并且往目标角度转动。 请注意,呼叫此函式后会让伺服机立即出力,请避免以手大力转动伺服机,以免受伤或损坏伺服机。 语法 servo.write(position) 参数 servo:Servo 型别的变数。 position:目标角度,可输入整数和浮点数型别的数值,当输入整数时,例如 1500,此时目标位置会被视为 us 单位,即对应 PWM 脉波为 1500us 的伺服机位置。当输入的是符点数时,例如 90.0,此时目标位置会被视为度单位,即伺服机的 90 度位置。 回传 范例 See also - writeMicroseconds() - read() - readMicroseconds() - setVelocity() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 […]
描述 检查 Servo 物件已是否呼叫 attach() 初始化并关连至一指定脚位上。 语法 servo.attached() 参数 servo:Servo 型别的变数。 回传 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.