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

Base class for motor abstraction components.
Inheritance: ComponentBase, IMotor
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Forward ( ) : void

Tells the motor to move forward.

Forward ( Int32 millis ) : void

Tells the motor to move forward for the specified amount of time.

IsState ( MotorState state ) : System.Boolean

Determines whether the motor's current state is the specified state.

Reverse ( ) : void

Tells the motor to reverse direction.

Reverse ( Int32 millis ) : void

Tells the motor to reverse direction for the specified amount of time.

Stop ( ) : void

Stops the motor's movement.

Protected Methods

Method Description
MotorBase ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Motors.MotorBase class. This is the default constructor.

OnMotorStateChanged ( MotorStateChangeEventArgs e ) : void

Raises the motor state changed event.

Method Details

Forward() public method

Tells the motor to move forward.
public Forward ( ) : void
return void

Forward() public method

Tells the motor to move forward for the specified amount of time.
public Forward ( Int32 millis ) : void
millis System.Int32 /// The number of milliseconds to continue moving forward for. ///
return void

IsState() public method

Determines whether the motor's current state is the specified state.
public IsState ( MotorState state ) : System.Boolean
state MotorState /// The state to check for. ///
return System.Boolean

MotorBase() protected method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Motors.MotorBase class. This is the default constructor.
protected MotorBase ( ) : System
return System

OnMotorStateChanged() protected method

Raises the motor state changed event.
protected OnMotorStateChanged ( MotorStateChangeEventArgs e ) : void
e MotorStateChangeEventArgs /// The event arguments. ///
return void

Reverse() public method

Tells the motor to reverse direction.
public Reverse ( ) : void
return void

Reverse() public method

Tells the motor to reverse direction for the specified amount of time.
public Reverse ( Int32 millis ) : void
millis System.Int32 /// The number of milliseconds to continue moving in reverse for. ///
return void

Stop() public method

Stops the motor's movement.
public Stop ( ) : void
return void