描述 存放机器人各轴伺服机偏移量微调值的整数阵列,每个阵列元素数值范围为 -256 ~ 256,单位为 us。 若 ServoOffset 在初始化时,没有指定载入偏移量微调值档案,则使用者可改由直接设定此阵列的元素值来设定偏移量微调值。 语法 myoffset.offsets[channel] 参数 myoffset:ServoOffset 型别的物件。 channel:指定阵列元素,范围为 0 ~ 44。第 n 个元素值代表要指定给第 n 个 Servo 的位置,请见下面范例说明。(注意:在 86Duino One 上所有阵列元素都有效;在86Duino EduCake 上只有 0 ~ 25 的范围有效;在 86Duino Zero 上只有 0 ~ 16 的范围有效。) 回传 范例 See also - setOffsets 函式库参考主页面 The text of the 86Duino reference is […]
描述 将指定伺服机的目标位置设定为 positions[] 阵列储存的动作帧内容,同时命令伺服机转动。 呼叫 playPositions() 后,您的程式可以去做其他事情,转动伺服机的工作会在背景执行,如果想知道伺服机是否转到目标位置,可以呼叫 isServoMultiMoving() 来检查。 语法 myframe.playPositions() myframe.playPositions(servo0) myframe.playPositions(servo0, servo1) myframe.playPositions(servo0, servo1, ... , servo44) myframe.playPositions(time) myframe.playPositions(time, servo0) myframe.playPositions(time, servo0, servo1) myframe.playPositions(time, servo0, servo1, ... , servo44) 参数 myframe:ServoFrame 型别的物件。 servo0 ~ servo44(可选):Servo 型别的物件;其中 servo0 使用 positions[0] 的值,servo1 使用 positions[1] 的值,以此类推。 time(可选):设定伺服机一起转动到目标位置所使用的时间;若没有设定此值,或者将其设定为 0,则伺服机将会以全速转动。 回传 范例 See also - positions[] - […]
描述 载入由 save() 函式储存的动作帧档案。(载入完成后,使用者可在 positions[] 阵列中取得动作帧内容。) 语法 myframe.load(filename) 参数 myframe:ServoFrame 型别的物件。 filename:动作帧档案的名称。注意:此函式只会到 SD 卡的根目录下寻找动作帧档案,假如您的 86Duino 没有插入 SD 卡,或者 SD 卡中没有指定档案,则载入会失败。 回传 true:档案载入成功。 false:档案载入失败。 范例 See also - positions[] - save() 函式库参考主页面 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 […]
描述 将 positions[] 阵列的内容储存至指定的动作帧档案。 语法 myframe.save(filename) 参数 myframe:ServoFrame 型别的物件。 filename:动作帧档案的名称。注意:档案会储存至 SD 卡的根目录下,假如您的 86Duino 没有插入 SD 卡,则储存会失败。 回传 true:档案储存成功。 false:档案储存失败。 范例 See also - positions[] - load() 函式库参考主页面 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.
描述 存放机器人动作帧的整数阵列,每个阵列元素的值对应一个机器人伺服机的位置,单位为 us。 若 ServoFrame 在初始化时,没有指定载入动作帧档案,则使用者可改由直接设定此阵列的元素值来设定动作帧。 语法 myframe.positions[channel] 参数 myframe:ServoFrame 型别的物件。 channel:指定阵列元素,范围为 0 ~ 44。第 n 个元素值代表要指定给第 n 个 Servo 的位置,请见下面范例说明。(注意:在 86Duino One 上所有阵列元素都有效;在86Duino EduCake 上只有 0 ~ 25 的范围有效;在 86Duino Zero 上只有 0 ~ 16 的范围有效。) 回传 范例 See also - setPostions() - playPositions() 函式库参考主页面 The text of the 86Duino reference is licensed […]
描述 将指定伺服机的目标位置设定为 positions[] 阵列储存的动作帧内容。 语法 myframe.setPositions() myframe.setPositions(servo0) myframe.setPositions(servo0, servo1) myframe.setPositions(servo0, servo1, ... , servo44) myframe.setPositions(time) myframe.setPositions(time, servo0) myframe.setPositions(time, servo0, servo1) myframe.setPositions(time, servo0, servo1, ... , servo44) 参数 myframe:ServoFrame 型别的物件。 servo0 ~ servo44(可选):Servo 型别的物件;其中 servo0 使用 positions[0] 的值,servo1 使用 positions[1] 的值,以此类推。 (注意:若没有输入上述参数,则内定以第一个在程式中被建构的 Servo 物件做为 servo0,第二个被建构的 Servo 物件做为 servo1,以此类推。) time(可选):设定伺服机一起转动到目标位置所使用的时间;若没有设定此值,或者将其设定为 0,则伺服机将会以全速转动。 回传 范例 See also - […]
描述 读取伺服机目前角度。 语法 servo.read() 参数 servo:Servo 型别的变数。 回传 伺服机目前的角度(型别为 double 浮点数),如果伺服机尚未出力,回传值为 0.0。(单位:度) 范例 See also - write() - writeMicroseconds() - readMicroseconds() 函式库参考主页面 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 […]
描述 将指定值补偿至伺服机的当前位置控制周期。 对于一些身上带有感测器(例如陀螺仪或加速度计)的机器人,此函式可用来将感测器侦测到的物理量反馈到机器人的动作上。 语法 servo.setRealTimeMixing(value) 参数 servo:Servo 型别的变数。 value:位置补偿值,单位:us。当伺服机正在运转时,此补偿值会被即时加到伺服机当前位置控制周期所计算出的目标角度上。 回传 范例 See also - write() - writeMicroseconds() - run() 函式库参考主页面 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.
描述 释放伺服机的出力,使伺服机处于脱力状态。 当呼叫 run(),或者 write()、writeMicroseconds(),将会使伺服机再次出力。 语法 servo.release() 参数 servo:Servo 型别的变数。 回传 范例 See also - setPosition() - run() 函式库参考主页面 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.
描述 设定伺服机的中心位置偏移量。 有些型号的 RC 伺服机由于生产上的差异,彼此在中心位置上可能具有些许误差。此函式可用来补偿伺服机的中心位置误差,一旦透过此函式设定了中心位置偏移量,往后函式库在计算伺服机目标角度时,会自动加上该偏移量来计算实际的目标角度。 语法 servo.setOffset(value) 参数 servo:Servo 型别的变数。 value:偏移植,范围:-256~ 256,单位:us。 回传 范例 See also - write() - writeMicroseconds() - ServoOffset 函式库参考主页面 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.