Motor Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for