Skip to main content

Class SparkFunQwiicLEDStick

Represents a SparkFunQwiicLEDStick that uses APA102 leds

Assembly: Apa102.dll
View Source
public class SparkFunQwiicLEDStick : I2cCommunications, II2cCommunications, IByteCommunications, IApa102

Inheritance: System.Object -> Meadow.Foundation.I2cCommunications

Implements:
Meadow.Hardware.II2cCommunications, Meadow.Hardware.IByteCommunications, Meadow.Foundation.Leds.IApa102

Properties

AutoWrite

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

View Source
public bool AutoWrite { get; set; }

Brightness

The led brightness (0-1)

View Source
public float Brightness { get; set; }

Methods

All(Color, float)

Sets all LEDs to a given color

View Source
public void All(Color color, float brightness = 1)
Parameters
TypeNameDescription
Meadow.ColorcolorThe led color
System.SinglebrightnessThe led brightness (0-1)

SetLed(int, Color)

Set the color of the specified LED

View Source
public virtual void SetLed(int index, Color color)
Parameters
TypeNameDescription
System.Int32indexIndex of the LED to change
Meadow.ColorcolorThe color

SetLed(int, Color, float)

Set the color of the specified LED

View Source
public virtual void SetLed(int index, Color color, float brightness = 1)
Parameters
TypeNameDescription
System.Int32indexIndex of the LED to change
Meadow.ColorcolorThe color
System.SinglebrightnessThe brightness 0.0 - 1.0f

SetLed(int, byte[])

Set the color of the specified LED

View Source
public virtual void SetLed(int index, byte[] rgb)
Parameters
TypeNameDescription
System.Int32indexIndex of the LED to change
System.Byte[]rgbByte 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

View Source
public virtual void SetLed(int index, byte[] rgb, float brightness = 1)
Parameters
TypeNameDescription
System.Int32indexIndex of the LED to change
System.Byte[]rgbByte array representing the color RGB values. byte[0] = Red, byte[1] = Green, byte[2] = Blue
System.SinglebrightnessThe brightness 0.0 - 1.0f

Show()

Transmit the changes to the LEDs

View Source
public void Show()

Clear(bool)

Turn off all the Leds

View Source
public void Clear(bool update = false)
Parameters
TypeName
System.Booleanupdate

Implements