Skip to main content

Interface IPositionalMotor

Represents an interface for controlling a positional motor.

Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface IPositionalMotor : IVariableSpeedMotor, IMotor

Properties

Position

Gets the current position of the motor.

View Source
Declaration
Angle Position { get; }

Methods

GoTo(Angle, AngularVelocity, CancellationToken)

Moves the motor to the specified position with the given velocity.

View Source
Declaration
Task GoTo(Angle position, AngularVelocity velocity, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Units.AnglepositionThe target position to move to.
Meadow.Units.AngularVelocityvelocityThe angular velocity of the motor during the movement.
System.Threading.CancellationTokencancellationTokenA token to cancel the operation.

GoTo(Angle, RotationDirection, AngularVelocity, CancellationToken)

Moves the motor to the specified position and direction with the given velocity.

View Source
Declaration
Task GoTo(Angle position, RotationDirection direction, AngularVelocity velocity, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Units.AnglepositionThe target position to move to.
Meadow.Peripherals.RotationDirectiondirectionThe direction in which to move the motor.
Meadow.Units.AngularVelocityvelocityThe angular velocity of the motor during the movement.
System.Threading.CancellationTokencancellationTokenA token to cancel the operation.

ResetPosition(CancellationToken)

Resets the position of the motor.

View Source
Declaration
Task ResetPosition(CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.Threading.CancellationTokencancellationTokenA token to cancel the operation.

Rotate(Angle, RotationDirection, AngularVelocity, CancellationToken)

Rotates the motor by the specified angle and direction with the given velocity.

View Source
Declaration
Task Rotate(Angle amountToRotate, RotationDirection direction, AngularVelocity velocity, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Units.AngleamountToRotateThe angle by which to rotate the motor.
Meadow.Peripherals.RotationDirectiondirectionThe direction in which to rotate the motor.
Meadow.Units.AngularVelocityvelocityThe angular velocity of the motor during the rotation.
System.Threading.CancellationTokencancellationTokenA token to cancel the operation.