ActiveMotor Class

Definition

Active motor

public class ActiveMotor : Iot.Device.BuildHat.Sensors.ActiveSensor, Iot.Device.BuildHat.Motors.IMotor
type ActiveMotor = class
    inherit ActiveSensor
    interface IMotor
Public Class ActiveMotor
Inherits ActiveSensor
Implements IMotor
Inheritance
ActiveMotor
Implements

Constructors

ActiveMotor(Brick, SensorPort, SensorType)

Creates an active motor.

Properties

AbsolutePosition

Gets the current tachometer count.

BaudRate

Baud rate the sensor is connected

(Inherited from ActiveSensor)
CombiModes

Gets the possible combi modes. Note, is will be empty if none.

(Inherited from ActiveSensor)
HardwareVersion

Hardware version

(Inherited from ActiveSensor)
IsConnected

Gets true if the sensor is connected.

(Inherited from Sensor)
ModeDetails

Gets the mode details of the sensor.

(Inherited from ActiveSensor)
NumberOfModes

Numbers the of modes.

(Inherited from ActiveSensor)
Port

Gets the Sensor port

(Inherited from Sensor)
Position

Gets the current tachometer count.

PositionPid

Gets the recommended Speed PID settings

(Inherited from ActiveSensor)
SensorName

Gets the name of the sensor.

SensorType

Gets the sensor type

(Inherited from Sensor)
SoftwareVersion

Software version

(Inherited from ActiveSensor)
Speed

Gets the speed of the motor speed is between -100 and +100

SpeedPid

Gets the recommended Speed PID settings

(Inherited from ActiveSensor)
TargetSpeed

Gets or sets the target speed

ValuesAsString

Property to return the raw value of the sensort as a string. It will contains as the first elements PxCy. x = the port number, y = 0 for continuous reading, 1 for single reading. The rest are the measures.

(Inherited from ActiveSensor)

Methods

Float()

Floats the motor and stop all constraints on it.

GetAbsolutePosition()

Gets the current absolute tachometer count.

GetMotorName()

Gets the name of the sensor.

GetPosition()

Gets the current tachometer count.

GetSpeed()

Get the speed

MoveForDegrees(Int32, Boolean)

Run the motor for a specific number of degrees.

MoveForSeconds(Double, Boolean)

Run the specified motors for an amount of seconds.

MoveToAbsolutePosition(Int32, PositionWay, Boolean)

Run the motor to an absolute position.

MoveToPosition(Int32, Boolean)

Run the motor to an absolute position.

OnPropertyChanged(String)

Raises the on property changed event.

(Inherited from Sensor)
OnPropertyUpdated(String)

Raises the on property updated event.

(Inherited from Sensor)
SelectCombiModesAndRead(Int32[], Boolean)

Returned the name of the selectd mode

(Inherited from ActiveSensor)
SelectModeAndRead(Int32, Boolean)

Returned the name of the selectd mode

(Inherited from ActiveSensor)
SetBias(Double)

Sets the bias of the motor.

SetPowerLimit(Double)

Sets the power consumption limit.

SetSpeed(Int32)

Set the speed of the motor

Start()

Start the motor

Start(Int32)

Start with the specified speed

Stop()

Stop the Motor

StopReading()

Stop reading continuous data from a specific sensor.

(Inherited from ActiveSensor)
SwitchOff(SensorPort)

Switches a sensor off.

(Inherited from ActiveSensor)
SwitchOn()

Switches a sensor on.

(Inherited from ActiveSensor)
WriteBytes(ReadOnlySpan<Byte>, Boolean)

Writes directly to the sensor. The bytes to the current port, the first one or two bytes being header bytes. The message is padded if necessary, and length and checksum fields are automatically populated.

(Inherited from ActiveSensor)

Events

PropertyChanged

To notify a property has changed. It means the value has changed.

(Inherited from Sensor)
PropertyUpdated

To notify a property has been updated. It means the property has been updated regardeless of a change in its value.

(Inherited from Sensor)

Applies to