Table of Contents

Class Pca9685

Namespace
Pamoja.Actuators
Assembly
Pamoja.Actuators.dll

An NXP PCA9685 16-channel PWM controller, for servos, LEDs, and valves.

public static class Pca9685
Inheritance
Pca9685
Inherited Members

Fields

Channels

How many channels it drives.

public const byte Channels = 16

Field Value

byte

Counts

How many counts each period is divided into.

public const ushort Counts = 4096

Field Value

ushort

InternalOscHz

The part's internal oscillator frequency, in hertz.

public const uint InternalOscHz = 25000000

Field Value

uint

Methods

ChannelRegister(byte)

Returns the first of a channel's four consecutive registers.

public static byte ChannelRegister(byte channel)

Parameters

channel byte

The channel, 0 to 15.

Returns

byte

The register address.

Exceptions

PamojaException

The channel is beyond the part.

FrequencyForPrescale(byte, uint)

Returns the update rate a prescale value produces.

public static float FrequencyForPrescale(byte prescale, uint oscHz = 25000000)

Parameters

prescale byte

The prescale register value.

oscHz uint

The oscillator frequency, usually InternalOscHz.

Returns

float

The frequency in hertz.

PrescaleForFrequency(uint, uint)

Returns the prescale value that sets an update rate.

public static byte PrescaleForFrequency(uint updateRateHz, uint oscHz = 25000000)

Parameters

updateRateHz uint

The PWM frequency wanted.

oscHz uint

The oscillator frequency, usually InternalOscHz.

Returns

byte

The prescale register value.