C# Класс BrickPi.Movement.Motor

This class contains a motor object and all needed functions and properties to pilot it
Наследование: INotifyPropertyChanged
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
OnPropertyChanged ( string name ) : void
StopTimerInternal ( ) : void

Описание методов

GetSpeed() публичный Метод

Get the speed
public GetSpeed ( ) : int
Результат int

GetTachoCount() публичный Метод

Gets the tacho count
public GetTachoCount ( ) : Int32
Результат System.Int32

Motor() публичный Метод

Create a motor
public Motor ( BrickPortMotor port ) : System
port BrickPortMotor Motor port
Результат System

Motor() публичный Метод

public Motor ( BrickPortMotor port, int timeout ) : System
port BrickPortMotor
timeout int
Результат System

SetPolarity() публичный Метод

Change the polatity of the motor
public SetPolarity ( Polarity polarity ) : void
polarity Polarity Polarity of the motor, backward, forward or opposite
Результат void

SetSpeed() публичный Метод

Set the speed of the motor
public SetSpeed ( int speed ) : void
speed int speed is between -255 and +255
Результат void

SetTachoCount() публичный Метод

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
Результат void

Start() публичный Метод

Start the motor
public Start ( ) : void
Результат void

Start() публичный Метод

Start with the specified speed
public Start ( int speed ) : void
speed int speed is between -255 and +255
Результат void

Stop() публичный Метод

Stop the Motor
public Stop ( ) : void
Результат void

UpdateSensor() публичный Метод

Update the sensor and this will raised an event on the interface
public UpdateSensor ( object state ) : void
state object
Результат void