Skip to main content

Class CwCcwStepper

A stepper motor that uses separate GPIO pulses for clockwise and counter-clockwise movement

Assembly: GpioStepper.dll
View Source
Declaration
public class CwCcwStepper : GpioStepperBase, IStepperMotor, IPositionalMotor, IVariableSpeedMotor, IMotor

Inheritance: System.Object -> Meadow.Foundation.Motors.Stepper.GpioStepperBase

Implements:
Meadow.Peripherals.Motors.IStepperMotor, Meadow.Peripherals.Motors.IPositionalMotor, Meadow.Peripherals.Motors.IVariableSpeedMotor, Meadow.Peripherals.Motors.IMotor

Properties

MinimumStartupDwellMicroseconds

Gets or sets the minimum step dwell time when motor changes from stationary to moving. Motors with more mass or larger steps require more dwell.

View Source
Declaration
public int MinimumStartupDwellMicroseconds { get; set; }

LinearAccelerationConstant

Gets or sets a constant that affects the rate of linear acceleration for the motor. A lower value yields faster acceleration. Motors with more mass or larger steps require slower acceleration

View Source
Declaration
public int LinearAccelerationConstant { get; set; }

StepsPerRevolution

Gets the number of steps required for the stepper motor to complete one full revolution.

View Source
Declaration
public override int StepsPerRevolution { get; }

InverseLogic

Gets a value indicating whether or not the logic for the stepper motor driver is inverted.

View Source
Declaration
public bool InverseLogic { get; }

IsMoving

Gets a value indicating whether the motor is currently in motion.

View Source
Declaration
public override bool IsMoving { get; }

Position

Gets the current position of the motor.

View Source
Declaration
public override Angle Position { get; }

MaxVelocity

Gets the maximum run velocity for the motor

View Source
Declaration
public override AngularVelocity MaxVelocity { get; }

Methods

ResetPosition(CancellationToken)

Resets the position of the motor.

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

System.Threading.Tasks.Task

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

Rotate(int, RotationDirection, Frequency, CancellationToken)

Rotates the stepper motor by the specified number of steps in the specified direction with the given frequency.

View Source
Declaration
public override Task Rotate(int steps, RotationDirection direction, Frequency rate, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.Int32stepsThe number of steps to rotate the motor.
Meadow.Peripherals.RotationDirectiondirectionThe direction in which to rotate the motor.
Meadow.Units.FrequencyrateThe frequency of the steps at which to rotate the motor.
System.Threading.CancellationTokencancellationTokenA token to cancel the operation.

Stop(CancellationToken)

Stops the motor.

View Source
Declaration
public override Task Stop(CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: A task representing the asynchronous operation.

Parameters
TypeNameDescription
System.Threading.CancellationTokencancellationTokenOptional cancellation token to stop the operation.

Implements

  • Meadow.Peripherals.Motors.IStepperMotor
  • Meadow.Peripherals.Motors.IPositionalMotor
  • Meadow.Peripherals.Motors.IVariableSpeedMotor
  • Meadow.Peripherals.Motors.IMotor