MotorHat Constructors
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.
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
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