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