MotorHat Constructors

Definition

Overloads

MotorHat(I2cConnectionSettings, Double)

Initializes a new instance of the MotorHat class with the specified I2C settings and PWM frequency.

MotorHat(Double, Int32)

Initializes a new instance of the MotorHat class with the default I2C address and PWM frequency.

MotorHat(I2cConnectionSettings, Double, IMotorPinProvider)

Initializes a new instance of the MotorHat class with the specified I2C settings and PWM frequency.

MotorHat(I2cConnectionSettings, Double)

Initializes a new instance of the MotorHat class with the specified I2C settings and PWM frequency.

public MotorHat (System.Device.I2c.I2cConnectionSettings settings, double frequency = 1600);
new Iot.Device.MotorHat.MotorHat : System.Device.I2c.I2cConnectionSettings * double -> Iot.Device.MotorHat.MotorHat
Public Sub New (settings As I2cConnectionSettings, Optional frequency As Double = 1600)

Parameters

settings
I2cConnectionSettings

The I2C settings of the MotorHat.

frequency
Double

The frequency in Hz to set the PWM controller.

Remarks

The default i2c address is 0x60, but the HAT can be configured in hardware to any address from 0x60 to 0x7f. The PWM hardware used by this HAT is a PCA9685. It has a total possible frequency range of 24 to 1526 Hz. Setting the frequency above or below this range will cause PWM hardware to be set at its maximum or minimum setting.

Applies to

MotorHat(Double, Int32)

Initializes a new instance of the MotorHat class with the default I2C address and PWM frequency.

public MotorHat (double frequency = 1600, int selectedAddress = 0);
new Iot.Device.MotorHat.MotorHat : double * int -> Iot.Device.MotorHat.MotorHat
Public Sub New (Optional frequency As Double = 1600, Optional selectedAddress As Integer = 0)

Parameters

frequency
Double

The frequency in Hz to set the PWM controller.

selectedAddress
Int32

The I2C settings of the MotorHat. 0 by default if jumpers were not changed Use the following code to set an address equivalent to the one configured in your device jumpers var selectedAddress = 0b000000; // were bits represents jumpers A5 A4 A3 A2 A1 A0

Remarks

The MotorHat will be created with the default I2C address of 0x60 and PWM frequency of 1600 Hz.

Applies to

MotorHat(I2cConnectionSettings, Double, IMotorPinProvider)

Initializes a new instance of the MotorHat class with the specified I2C settings and PWM frequency.

public MotorHat (System.Device.I2c.I2cConnectionSettings settings, double frequency = 1600, Iot.Device.MotorHat.IMotorPinProvider? pinProvider = default);
new Iot.Device.MotorHat.MotorHat : System.Device.I2c.I2cConnectionSettings * double * Iot.Device.MotorHat.IMotorPinProvider -> Iot.Device.MotorHat.MotorHat
Public Sub New (settings As I2cConnectionSettings, Optional frequency As Double = 1600, Optional pinProvider As IMotorPinProvider = Nothing)

Parameters

settings
I2cConnectionSettings

The I2C settings of the MotorHat.

frequency
Double

The frequency in Hz to set the PWM controller.

pinProvider
IMotorPinProvider

The IMotorPinProvider that provides MotorPins for various hats.

Remarks

The default i2c address is 0x60, but the HAT can be configured in hardware to any address from 0x60 to 0x7f. The PWM hardware used by this HAT is a PCA9685. It has a total possible frequency range of 24 to 1526 Hz. Setting the frequency above or below this range will cause PWM hardware to be set at its maximum or minimum setting.

Applies to