MotorHat.CreateServoMotor(Int32, Double, Double, Double) Method

Definition

Creates a Iot.Device.ServoMotor from one of the 4 available PWM channels in the MotorHat

public Iot.Device.ServoMotor.ServoMotor CreateServoMotor (int channelNumber, double maximumAngle = 180, double minimumPulseWidthMicroseconds = 1000, double maximumPulseWidthMicroseconds = 2000);
member this.CreateServoMotor : int * double * double * double -> Iot.Device.ServoMotor.ServoMotor
Public Function CreateServoMotor (channelNumber As Integer, Optional maximumAngle As Double = 180, Optional minimumPulseWidthMicroseconds As Double = 1000, Optional maximumPulseWidthMicroseconds As Double = 2000) As ServoMotor

Parameters

channelNumber
Int32

A valid PWM channel (0, 1, 14 or 15)

maximumAngle
Double

The maximum angle the servo motor can move represented as a value between 0 and 360.

minimumPulseWidthMicroseconds
Double

The minimum pulse width, in microseconds, that represent an angle for 0 degrees.

maximumPulseWidthMicroseconds
Double

The maxnimum pulse width, in microseconds, that represent an angle for maximum angle.

Returns

Remarks

The channelNumber refers to ont of the available PWM channel numbers available in the Motor Hat (0, 1, 14, 15) printed in the device.

Applies to