Class Ws2812
Represents WS2812/Neopixel Led(s)
Assembly: Ws2812.dll
View Source
public class Ws2812 : ISpiPeripheral, IDisposable
Implements:
Meadow.Hardware.ISpiPeripheral
, System.IDisposable
Properties
DefaultSpiBusSpeed
The default SPI bus speed for the device
View Source
public Frequency DefaultSpiBusSpeed { get; }
SpiBusSpeed
The SPI bus speed for the device
View Source
public Frequency SpiBusSpeed { get; set; }
DefaultSpiBusMode
The default SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }
SpiBusMode
The SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode SpiBusMode { get; set; }
NumberOfLeds
Total number of leds
View Source
public int NumberOfLeds { get; }
IsDisposed
Is the object disposed
View Source
public bool IsDisposed { get; }
Fields
spiComms
SPI Communication bus used to communicate with the peripheral
View Source
protected ISpiCommunications spiComms
Methods
SetLed(int, Color)
Set the color of the specified LED
View Source
public void SetLed(int index, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the LED to change |
Meadow.Color | color | The color |
SetLed(int, byte[])
Set the color of the specified LED
View Source
public 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 |
Show()
Transmit the buffer to the LEDs
View Source
public void Show()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
Dispose(bool)
Dispose of the object
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Is disposing |
Implements
Meadow.Hardware.ISpiPeripheral
System.IDisposable