ServoFrameKondo.capture()

[Servo86]

Description

Reads the current position of the specified KONDO servo.

KONDO’s RC servo provides a special function to return the current position. This function supports this function and can be used to read the actual position of KRS-786/788HV and KRS-4012/4014HV servos.

Notes on use.

Before calling this function, make sure that all servos are in the disengaged state before this function will work; if there are still servos in the disengaged state, call the release() function of the Servo class to disengage the servos first.

The signal line of KONDO servo needs to be connected to the lifting resistor so that 86Duino can read the position of its return. Please refer to the KONDO servo wiring example.

Syntax

myframe.capture(servo)

Parameters

  • myframe: the object of type ServoFrameKondo.
  • servo: the object of type Servo.

Returns

The current position of the KONDO servo return. If the reading fails, 0 is returned.

Example

#include <Servo86.h>
  
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoFrameKondo myframe;
 
void setup()
{
   myservo0.attach(9);
   myservo1.attach(11);
   myservo2.attach(5);
 
   // read the current position of myservo0, myservo1, myservo2
   myframe.positions[0] = myframe.capture(myservo0);
   myframe.positions[1] = myframe.capture(myservo1);
   myframe.positions[2] = myframe.capture(myservo2);
 
   Serial.println(myframe.positions[0]);
   Serial.println(myframe.positions[1]);
   Serial.println(myframe.positions[2]);
   myframe.save("captured_frame.txt");
}
 
void loop() {}

See also


Libraries Reference Home

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.

Leave a Comment

Scroll to Top