setOffsets()
描述
將 Offset 偏移量列表分別指定給各伺服機。
語法
servooffsetvstone.setOffsets()
servooffsetvstone.setOffsets(servo1)
servooffsetvstone.setOffsets(servo1, servo2)
servooffsetvstone.setOffsets(servo1, servo2, ... , servo45)
參數
servooffsetvstone
:ServoOffsetVstone
型別的變數。
servo1 ~ servo45
:Servo
型別的變數。
回傳
無
範例
#include <Servo86.h> Servo myservo0; Servo myservo1; Servo myservo2; ServoOffsetVstone myoffset; void setup() { myservo0.attach(9); myservo1.attach(11); myservo2.attach(5); myoffset.offsets[0] = -200; // 設定 Offset 內容 myoffset.offsets[1] = 50; myoffset.offsets[2] = -100; // 將 Offset 的值指定到伺服機 (offsets[0] 的值指定到 myservo0 // ,offsets[1] 的值指定到 myservo1,offsets[2] 的值指定到 myservo2) myoffset.setOffsets(myservo0, myservo1, myservo2); } void loop() {}
See also
- offsets[]
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.