Skip to main content

Meadow.Foundation.ICs.DigiPots.Ds3502

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

Code Example

protected Ds3502 ds3502;

public override Task Initialize()
{
Resolver.Log.Info("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);
Resolver.Log.Info($"wiper {ds3502.GetWiper()}");

Thread.Sleep(1000);
}

return base.Run();
}

Sample project(s) available on GitHub

Class Ds3502

Represents a DS3502 digital potentiometer

Assembly: Ds3502.dll
View Source
Declaration
public class Ds3502 : II2cPeripheral

Implements:
Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

DefaultBusSpeed

Default I2C bus speed

View Source
Declaration
public static I2cBusSpeed DefaultBusSpeed { get; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
Declaration
protected readonly II2cCommunications i2cComms

Methods

GetWiper()

Get the current wiper value

View Source
Declaration
public byte GetWiper()
Returns

System.Byte: the 7-bit wiper value### SetWiper(byte) Set the wiper value

View Source
Declaration
public void SetWiper(byte value)
Parameters
TypeNameDescription
System.Bytevaluewiper value (0-127)

SetWiperDefault(byte)

Set the default wiper value

View Source
Declaration
public Task SetWiperDefault(byte value)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.Bytevaluewiper value (0-127)

Implements

  • Meadow.Hardware.II2cPeripheral