Skip to main content

Meadow.Foundation.ICs.IOExpanders.Pca9685

Pca9685
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.ICs.IOExpanders.Pca9685

Code Example

Pca9685 pca9685;

public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
var i2CBus = Device.CreateI2cBus(I2cBusSpeed.FastPlus);

pca9685 = new Pca9685(i2CBus, new Meadow.Units.Frequency(50, Meadow.Units.Frequency.UnitType.Hertz), (byte)Pca9685.Addresses.Default);
pca9685.Initialize();

return base.Initialize();
}

public override Task Run()
{
var port0 = pca9685.CreatePwmPort(0, 0.05f);
var port7 = pca9685.CreatePwmPort(7);

port0.Start();
port7.Start();

return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a PCA9685 to your Meadow board, connect the following: