C# Class BrickPi.Movement.Motor

This class contains a motor object and all needed functions and properties to pilot it
Inheritance: INotifyPropertyChanged
Afficher le fichier Open project: Ellerbach/BrickPi

Méthodes publiques

Méthode Description
GetSpeed ( ) : int

Get the speed

GetTachoCount ( ) : Int32

Gets the tacho count

Motor ( BrickPortMotor port ) : System

Create a motor

Motor ( BrickPortMotor port, int timeout ) : System
SetPolarity ( Polarity polarity ) : void

Change the polatity of the motor

SetSpeed ( int speed ) : void

Set the speed of the motor

SetTachoCount ( Int32 position ) : void

Set Tachometer encoder offset Use this to reset or setup a specific position

Start ( ) : void

Start the motor

Start ( int speed ) : void

Start with the specified speed

Stop ( ) : void

Stop the Motor

UpdateSensor ( object state ) : void

Update the sensor and this will raised an event on the interface

Private Methods

Méthode Description
OnPropertyChanged ( string name ) : void
StopTimerInternal ( ) : void

Method Details

GetSpeed() public méthode

Get the speed
public GetSpeed ( ) : int
Résultat int

GetTachoCount() public méthode

Gets the tacho count
public GetTachoCount ( ) : Int32
Résultat System.Int32

Motor() public méthode

Create a motor
public Motor ( BrickPortMotor port ) : System
port BrickPortMotor Motor port
Résultat System

Motor() public méthode

public Motor ( BrickPortMotor port, int timeout ) : System
port BrickPortMotor
timeout int
Résultat System

SetPolarity() public méthode

Change the polatity of the motor
public SetPolarity ( Polarity polarity ) : void
polarity Polarity Polarity of the motor, backward, forward or opposite
Résultat void

SetSpeed() public méthode

Set the speed of the motor
public SetSpeed ( int speed ) : void
speed int speed is between -255 and +255
Résultat void

SetTachoCount() public méthode

Set Tachometer encoder offset Use this to reset or setup a specific position
public SetTachoCount ( Int32 position ) : void
position System.Int32 New offset, 0 to reset
Résultat void

Start() public méthode

Start the motor
public Start ( ) : void
Résultat void

Start() public méthode

Start with the specified speed
public Start ( int speed ) : void
speed int speed is between -255 and +255
Résultat void

Stop() public méthode

Stop the Motor
public Stop ( ) : void
Résultat void

UpdateSensor() public méthode

Update the sensor and this will raised an event on the interface
public UpdateSensor ( object state ) : void
state object
Résultat void