我想找...

搜尋

分享

目錄

ServoOffsetKondo.offsets[]

[Servo86]

描述

Save the user-defined robot offset. The range of each Servo offset is from -256 to 256, and the unit is us.

The first element of the array represents the Servo offset of the first channel, the second element represents the Servo offset of the second channel, and so on.

You can call attach() to specify the 86Duino pins to which offsets[] corresponds (see example below).

語法

servooffsetkondo.offsets[channel]

參數

  • servooffsetkondo: Variable of ServoOffsetKondo type.
  • channel: range: 0 ~ 44, the value represents the nth channel of Servo.

If you use load() to read the KONDO Offset file, then the number of channels will be fixed to 24, and the Offset values of the 0th to 23rd channels are stored in offsets[0], offsets[1] … offsets[23], after the 23rd group After group 23, the content of offsets[] is all 0.

回傳

範例

#include <Servo86.h>
 
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoOffsetKondo myoffset;
 
void setup()
{
   myservo0.attach(9); myservo1.attach(11); myservo2.attach(5);
   myoffset.offsets[0] = -200; // set Offset content
   myoffset.offsets[1] = 50;
   myoffset.offsets[2] = -100;
   // assign the Offset value to the servo (offsets[0] assigns the value to myservo0,
   // The value of offsets[1] is assigned to myservo1, and the value of offsets[2] is assigned to myservo2)
   myoffset.setOffsets(myservo0, myservo1, myservo2);
}
 
void loop() {}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。

返回頂端