Meadow.Foundation.ICs.DigiPots.Ds3502
Ds3502 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
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
Type | Name | Description |
---|---|---|
System.Byte | value | wiper value (0-127) |
SetWiperDefault(byte)
Set the default wiper value
View Source
Declaration
public Task SetWiperDefault(byte value)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | wiper value (0-127) |
Implements
Meadow.Hardware.II2cPeripheral