Motor Class

Definition

This class contains a motor object and all needed functions and properties to pilot it

public class Motor : System.ComponentModel.INotifyPropertyChanged
type Motor = class
    interface INotifyPropertyChanged
Public Class Motor
Implements INotifyPropertyChanged
Inheritance
Motor
Implements

Constructors

Motor(Brick, BrickPortMotor)

Create a motor

Motor(Brick, BrickPortMotor, Int32)

Create a motor

Properties

PeriodRefresh

Period to refresh the notification of property changed in milliseconds

Port

Motor port

Speed

Set or read the speed of the motor speed is between -255 and +255

TachoCount

Tacho count as a property, events are rasied when value is changing

Methods

GetSpeed()

Get the speed

GetTachoCount()

Gets the tacho count

SetPolarity(Polarity)

Change the polatity of the motor

SetSpeed(Int32)

Set the speed of the motor

SetTachoCount(Int32)

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

Start()

Start the motor

Start(Int32)

Start with the specified speed

Stop()

Stop the Motor

UpdateSensor(Object)

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

Events

PropertyChanged

To notify a property has changed. The minimum time can be set up with timeout property

Applies to