Remarks

Ds3502
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.ICs.IOExpanders.Ds3502

Code Example

protected Ds3502 ds3502;

public override Task Initialize()
{
    Console.WriteLine("Initialize...");

    ds3502 = new Ds3502(Device.CreateI2cBus(Ds3502.DefaultBusSpeed));

    return base.Initialize();
}

public override Task Run()
{
    for (byte i = 0; i < 127; i++)
    {
        ds3502.SetWiper(i);
        Console.WriteLine($"wiper {ds3502.GetWiper()}");

        Thread.Sleep(1000);
    }

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

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

Ds3502 Meadow Pin
GND GND
VCC 3V3
SCL D08 (SCL Pin)
SDA D07 (SDA Pin)
Characteristic Locus
Inheritance System.Object > Ds3502
Namespace Meadow.Foundation.ICs.IOExpanders
Assembly Ds3502.dll

Syntax

public class Ds3502 : object

Constructors

Ds3502(II2cBus, Byte)

Create a new Ds3502 object using the default parameters

Declaration
public Ds3502(II2cBus i2cBus, byte address = null)

Parameters

Type Name Description
II2cBus i2cBus

I2C bus instance

System.Byte address

Address of the bus on the I2C display

Properties

DefaultBusSpeed

Default I2C bus speed

Declaration
public static I2cBusSpeed DefaultBusSpeed { get; }

Property Value

Type Description
I2cBusSpeed

Methods

GetWiper()

Get the current wiper value

Declaration
public byte GetWiper()

Returns

Type Description
System.Byte

the 7-bit wiper value

SetWiper(Byte)

Set the wiper value

Declaration
public void SetWiper(byte value)

Parameters

Type Name Description
System.Byte value

wiper value (0-127)

SetWiperDefault(Byte)

Set the default wiper value

Declaration
public Task SetWiperDefault(byte value)

Parameters

Type Name Description
System.Byte value

wiper value (0-127)

Returns

Type Description
Task