Skip to main content

Class Pca9685

Represents PCA9685 IC

Assembly: Pca9685.dll
View Source
public class Pca9685 : II2cPeripheral

Implements:
Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

i2cBus

The I2C bus connected to the pca9685

View Source
protected II2cBus i2cBus { get; set; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
protected readonly II2cCommunications i2cComms

Methods

Initialize()

Initializes the PCA9685 IC

View Source
public virtual void Initialize()

CreatePwmPort(byte, float)

Create a IPwmPort on the specified pin

View Source
public virtual IPwmPort CreatePwmPort(byte portNumber, float dutyCycle = 0.5)
Returns

Meadow.Hardware.IPwmPort: IPwmPort

Parameters
TypeNameDescription
System.ByteportNumberThe port number (0-15)
System.SingledutyCycleThe duty cycle for that port

SetPin(byte, bool)

Turns the specified pin On or Off

View Source
public virtual void SetPin(byte pin, bool on)
Parameters
TypeNameDescription
System.BytepinThe pin to set
System.Booleanontrue is on, false if off

SetPwm(byte, int, int)

Set the values for specified output pin.

View Source
public virtual void SetPwm(byte pin, int on, int off)
Parameters
TypeNameDescription
System.BytepinThe pwm Pin
System.Int32onLED{X}_ON_L and LED{X}_ON_H register value
System.Int32offLED{X}_OFF_L and LED{X}_OFF_H register value

Implements

  • Meadow.Hardware.II2cPeripheral