Characteristic Locus
Inheritance object I2cCommunications > SparkFunQwiicLEDStick
Implements II2cCommunications IByteCommunications IApa102
Inherited Members I2cCommunications.Address I2cCommunications.Bus I2cCommunications.WriteBuffer I2cCommunications.ReadBuffer I2cCommunications.Read(Span<byte>) I2cCommunications.ReadRegister(byte, Span<byte>) I2cCommunications.ReadRegister(byte) I2cCommunications.ReadRegisterAsUShort(byte, ByteOrder) I2cCommunications.Write(byte) I2cCommunications.Write(Span<byte>) I2cCommunications.WriteRegister(byte, byte) I2cCommunications.WriteRegister(byte, ushort, ByteOrder) I2cCommunications.WriteRegister(byte, uint, ByteOrder) I2cCommunications.WriteRegister(byte, ulong, ByteOrder) I2cCommunications.WriteRegister(byte, Span<byte>, ByteOrder) I2cCommunications.Exchange(Span<byte>, Span<byte>, DuplexType) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Leds
Assembly Apa102.dll

Syntax

public class SparkFunQwiicLEDStick : I2cCommunications, II2cCommunications, IByteCommunications, IApa102

Constructors

SparkFunQwiicLEDStick(II2cBus, byte)

Creates a new SparkFunQwiicLEDStick object

Declaration
public SparkFunQwiicLEDStick(II2cBus i2cbus, byte address = 35)

Parameters

Type Name Description
II2cBus i2cbus

The I2C bus

byte address

The I2C address

Properties

AutoWrite

Enable or disable autowrite to update the LEDs as they're set

Declaration
public bool AutoWrite { get; set; }

Property Value

Type Description
bool

Brightness

The led brightness (0-1)

Declaration
public float Brightness { get; set; }

Property Value

Type Description
float

Methods

All(Color, float)

Sets all LEDs to a given color

Declaration
public void All(Color color, float brightness = 1)

Parameters

Type Name Description
Color color

The led color

float brightness

The led brightness (0-1)

Clear(bool)

Turn off all the Leds

Declaration
public void Clear(bool update = false)

Parameters

Type Name Description
bool update

SetLed(int, Color)

Set the color of the specified LED

Declaration
public virtual void SetLed(int index, Color color)

Parameters

Type Name Description
int index

Index of the LED to change

Color color

The color

SetLed(int, Color, float)

Set the color of the specified LED

Declaration
public virtual void SetLed(int index, Color color, float brightness = 1)

Parameters

Type Name Description
int index

Index of the LED to change

Color color

The color

float brightness

The brightness 0.0 - 1.0f

SetLed(int, byte[])

Set the color of the specified LED

Declaration
public virtual void SetLed(int index, byte[] rgb)

Parameters

Type Name Description
int index

Index of the LED to change

byte[] rgb

Byte array representing the color RGB values. byte[0] = Red, byte[1] = Green, byte[2] = Blue

SetLed(int, byte[], float)

Set the color of the specified LED

Declaration
public virtual void SetLed(int index, byte[] rgb, float brightness = 1)

Parameters

Type Name Description
int index

Index of the LED to change

byte[] rgb

Byte array representing the color RGB values. byte[0] = Red, byte[1] = Green, byte[2] = Blue

float brightness

The brightness 0.0 - 1.0f

Show()

Transmit the changes to the LEDs

Declaration
public void Show()