C# Class CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent

A component that is an abstraction of a stepper motor.
Inheritance: StepperMotorBase
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Dipose ( ) : void

Releases all resources used by the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent was occupying.

Step ( Int32 steps ) : void

Step the motor the specified number of steps.

StepperMotorComponent ( IGpio pins ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent class with the output pins for each controller in the stepper motor.

ToString ( ) : String

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent.

Protected Methods

Method Description
Dispose ( System.Boolean disposing ) : void

Releaseses all resources used this object.

Private Methods

Method Description
BackgroundExecuteMovement ( ) : void

Moves the motor forward or backward until stopped. This method is meant to be executed in a background thread.

DoStep ( System.Boolean forward ) : void

Steps the the motor forward or backward.

ExecuteMovement ( ) : void

Executes the motor movement corresponding to the current motor state. If stopping, then turns all controller pins off; Otherwise, the forward or reverse movent is executed in a background thread.

Method Details

Dipose() public method

Releases all resources used by the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent was occupying.
public Dipose ( ) : void
return void

Dispose() protected method

Releaseses all resources used this object.
protected Dispose ( System.Boolean disposing ) : void
disposing System.Boolean /// Set true if disposing managed resources in addition to unmanaged. ///
return void

Step() public method

Step the motor the specified number of steps.
/// This instance has been disposed. ///
public Step ( Int32 steps ) : void
steps System.Int32 /// The number of steps to step the motor forward or backward. Set 0 /// to stop the motor. ///
return void

StepperMotorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent class with the output pins for each controller in the stepper motor.
public StepperMotorComponent ( IGpio pins ) : System
pins IGpio /// The output pins for each controller in the stepper motor. ///
return System

ToString() public method

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Motors.StepperMotorComponent.
public ToString ( ) : String
return String