Characteristic | Locus |
---|---|
Inheritance | System.Object I2cPeripheral > SparkFunQwiicLEDStick |
Implements | IApa102 |
Inherited Members | I2cPeripheral.Address I2cPeripheral.Bus I2cPeripheral.WriteBuffer I2cPeripheral.ReadBuffer Meadow.Hardware.I2cPeripheral.Read(Span<>) Meadow.Hardware.I2cPeripheral.ReadRegister(System.Byte, Span<>) I2cPeripheral.ReadRegister(Byte) I2cPeripheral.ReadRegisterAsUShort(Byte, ByteOrder) I2cPeripheral.Write(Byte) Meadow.Hardware.I2cPeripheral.Write(Span<>) I2cPeripheral.WriteRegister(Byte, Byte) I2cPeripheral.WriteRegister(Byte, UInt16, ByteOrder) I2cPeripheral.WriteRegister(Byte, UInt32, ByteOrder) I2cPeripheral.WriteRegister(Byte, UInt64, ByteOrder) Meadow.Hardware.I2cPeripheral.WriteRegister(System.Byte, Span<>, ByteOrder) Meadow.Hardware.I2cPeripheral.Exchange(Span<>, Span<>, DuplexType) |
Namespace | Meadow.Foundation.Leds |
Assembly | Apa102.dll |
Syntax
public class SparkFunQwiicLEDStick : I2cPeripheral, IApa102
Constructors
SparkFunQwiicLEDStick(II2cBus, Byte)
Creates a new SparkFunQwiicLEDStick object
Declaration
public SparkFunQwiicLEDStick(II2cBus i2cbus, byte address = null)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cbus | The I2C bus |
System.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 |
---|---|
System.Boolean |
Brightness
The led brightness (0-1)
Declaration
public float Brightness { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
All(Color, Single)
Sets all LEDs to a given color
Declaration
public void All(Color color, float brightness = 1F)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The led color |
System.Single | brightness | The led brightness (0-1) |
Clear(Boolean)
Turn off all the Leds
Declaration
public void Clear(bool update = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | update |
SetLed(Int32, Color)
Set the color of the specified LED
Declaration
public virtual void SetLed(int index, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the LED to change |
Color | color | The color |
SetLed(Int32, Color, Single)
Set the color of the specified LED
Declaration
public virtual void SetLed(int index, Color color, float brightness = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the LED to change |
Color | color | The color |
System.Single | brightness | The brighrness 0.0 - 1.0f |
SetLed(Int32, Byte[])
Set the color of the specified LED
Declaration
public virtual void SetLed(int index, byte[] rgb)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the LED to change |
System.Byte[] | rgb | Byte array representing the color RGB values. byte[0] = Red, byte[1] = Green, byte[2] = Blue |
SetLed(Int32, Byte[], Single)
Set the color of the specified LED
Declaration
public virtual void SetLed(int index, byte[] rgb, float brightness = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the LED to change |
System.Byte[] | rgb | Byte array representing the color RGB values. byte[0] = Red, byte[1] = Green, byte[2] = Blue |
System.Single | brightness | The brighrness 0.0 - 1.0f |
Show()
Transmit the changes to the LEDs
Declaration
public void Show()