Set position of a single servo.

Namespace:  AForge.Robotics.TeRK
Assembly:  AForge.Robotics.TeRK (in AForge.Robotics.TeRK.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public int SetPosition(
	int servo,
	int position
)

Parameters

servo
Type: System..::.Int32
Servo to set position for, [0, Count).
position
Type: System..::.Int32
Position to set for the specified servo, [0, 255].

Return Value

Returns current position of the specified servo.

Remarks

The method sets position of single Qwerk's servo, which index is specified. It is preferred to use SetPositions(array<Boolean>[]()[], array<Int32>[]()[]) for setting positions of multiple servos, which does it at once.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptionInvalid servo is specified.
AForge..::.NotConnectedExceptionNo connection to Qwerk or its service.
AForge..::.ConnectionLostExceptionConnestion to Qwerk is lost.

See Also