Skip to main content

Meadow.Foundation.ICs.IOExpanders.Tca9548a

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

[Explanation of the peripheral]

Code Example

IDigitalOutputPort bus0Port0;
IDigitalOutputPort bus1Port0;

public override Task Initialize()
{
Resolver.Log.Info("Initialize...");

var i2cBus = Device.CreateI2cBus(I2cBusSpeed.Standard);
var tca9548a = new Tca9548a(i2cBus, 0x70);
var mcp0 = new Mcp23008(tca9548a.Bus0);
var mcp1 = new Mcp23008(tca9548a.Bus1);

bus0Port0 = mcp0.CreateDigitalOutputPort(mcp0.Pins.GP0);
bus1Port0 = mcp1.CreateDigitalOutputPort(mcp1.Pins.GP0);

return base.Initialize();
}

public override async Task Run()
{
while (true)
{
bus0Port0.State = true;
bus1Port0.State = false;

await Task.Delay(1000);

bus0Port0.State = false;
bus1Port0.State = true;

await Task.Delay(1000);
}
}

Sample project(s) available on GitHub

Wiring Example

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

Tca9548aMeadow Pin
GNDGND
SCLD08 (SCL)
SDAD07 (SDA)
VCC3V3

It should look like the following diagram:

ToDo: Fritzing diagram here