Class Pca9685
Represents PCA9685 IC
Assembly: Pca9685.dll
View Source
Declaration
public class Pca9685 : II2cPeripheral
Implements:
Meadow.Hardware.II2cPeripheral
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
Declaration
public byte DefaultI2cAddress { get; }
i2cBus
The I2C bus connected to the pca9685
View Source
Declaration
protected II2cBus i2cBus { get; set; }
Fields
i2cComms
I2C Communication bus used to communicate with the peripheral
View Source
Declaration
protected readonly II2cCommunications i2cComms
Methods
Initialize()
Initializes the PCA9685 IC
View Source
Declaration
public virtual void Initialize()
CreatePwmPort(byte, float)
Create a IPwmPort on the specified pin
View Source
Declaration
public virtual IPwmPort CreatePwmPort(byte portNumber, float dutyCycle = 0.5)
Returns
Meadow.Hardware.IPwmPort
: IPwmPort
Parameters
Type | Name | Description |
---|---|---|
System.Byte | portNumber | The port number (0-15) |
System.Single | dutyCycle | The duty cycle for that port |
SetPin(byte, bool)
Turns the specified pin On or Off
View Source
Declaration
public virtual void SetPin(byte pin, bool on)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | pin | The pin to set |
System.Boolean | on | true is on, false if off |
SetPwm(byte, int, int)
Set the values for specified output pin.
View Source
Declaration
public virtual void SetPwm(byte pin, int on, int off)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | pin | The pwm Pin |
System.Int32 | on | LED{X}_ON_L and LED{X}_ON_H register value |
System.Int32 | off | LED{X}_OFF_L and LED{X}_OFF_H register value |
Implements
Meadow.Hardware.II2cPeripheral