Skip to main content

Class Pca9685

Represents a PCA9685

Assembly: Pca9685.dll
View Source
Declaration
public class Pca9685 : II2cPeripheral, IDigitalOutputController, IPwmOutputController, IPinController, IDisposable

Implements:
Meadow.Hardware.II2cPeripheral, Meadow.Hardware.IDigitalOutputController, Meadow.Hardware.IPwmOutputController, Meadow.Hardware.IPinController, System.IDisposable

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; }

Pins

PCA9685 pin definitions

View Source
Declaration
public Pca9685.PinDefinitions Pins { get; }

Frequency

The frequency for the PWM outputs

View Source
Declaration
public Frequency Frequency { get; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
Declaration
protected readonly II2cCommunications i2cComms

Methods

CreateDigitalOutputPort(IPin, bool, OutputType)

Creates an IDigitalOutputPort on the specified pin.

View Source
Declaration
public IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState = false, OutputType initialOutputType = OutputType.PushPull)
Returns

Meadow.Hardware.IDigitalOutputPort

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin on which to create the port.
System.BooleaninitialStateThe default initial state of the port,
either LOW (false), or HIGH (true).
Meadow.Hardware.OutputTypeinitialOutputTypeWhether the port is initially configured
as PushPull or OpenDrain. PushPull by default.

CreatePwmPort(IPin, float, bool)

View Source
Declaration
public IPwmPort CreatePwmPort(IPin pin, float dutyCycle = 0.5, bool invert = false)
Returns

Meadow.Hardware.IPwmPort

Parameters
TypeName
Meadow.Hardware.IPinpin
System.SingledutyCycle
System.Booleaninvert

CreatePwmPort(IPin, Frequency, float, bool)

Creates an IPwmPort on the specified pin.

View Source
Declaration
public IPwmPort CreatePwmPort(IPin pin, Frequency frequency, float dutyCycle = 0.5, bool invert = false)
Returns

Meadow.Hardware.IPwmPort: The created PWM port.

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin on which to create the PWM port.
Meadow.Units.FrequencyfrequencyThe desired frequency of the PWM signal.
System.SingledutyCycleThe desired duty cycle of the PWM signal. Defaults to Meadow.Hardware.IPwmOutputController.DefaultPwmDutyCycle.
System.BooleaninvertSpecifies whether the PWM signal should be inverted. Defaults to false.

Dispose(bool)

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
Declaration
public void Dispose()

Implements

  • Meadow.Hardware.II2cPeripheral
  • Meadow.Hardware.IDigitalOutputController
  • Meadow.Hardware.IPwmOutputController
  • Meadow.Hardware.IPinController
  • System.IDisposable