Class Pca9685
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
Counts
How many counts each period is divided into.
public const ushort Counts = 4096
Field Value
InternalOscHz
The part's internal oscillator frequency, in hertz.
public const uint InternalOscHz = 25000000
Field Value
Methods
ChannelRegister(byte)
Returns the first of a channel's four consecutive registers.
public static byte ChannelRegister(byte channel)
Parameters
channelbyteThe 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
prescalebyteThe prescale register value.
oscHzuintThe 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
updateRateHzuintThe PWM frequency wanted.
oscHzuintThe oscillator frequency, usually InternalOscHz.
Returns
- byte
The prescale register value.