This project is read-only.

Toolbox.NETMF.Hardware.RgbLedStrip

Toolbox.NETMF.Hardware.RgbLedStrip(Chipset, LedCount, SPI_Device)
Use this if you're driving the strip directly
  • Chipset The chip used for daisychaining
  • LedCount The amount of LEDs in the chain
  • SPI_Device The SPI-bus the chain is connected to

Toolbox.NETMF.Hardware.RgbLedStrip(Chipset, LedCount, SPIDevice, ChipSelectPort, ChipSelect_ActiveState)
Use this if you're using a schematic with chip select
  • Chipset The chip used for daisychaining
  • LedCount The amount of LEDs in the chain
  • SPI_Device The SPI-bus the chain is connected to
  • ChipSelect_Port The pin that's used as chip select pin
  • ChipSelectActiveState The state of the ChipSelectPort when active

Methods

All methods can use "Red, Green, Blue" instead of "Color" too.
All methods have a Delayed parameter. When set to False, the method will immediately write to the strip.
  • InsertColorAtBack(Color, Delayed = true) Shifts all LEDs to the right and adds a new one at the back
  • InsertColorAtFront(Color, Delayed = true) Shifts all LEDs to the left and adds a new one at the front
  • SetColorAll(Color, Delayed = true) Configures the color value of all LEDs
  • SetColor(LedNo, Color, Delayed = true) Configures the color value of a specific LED
  • SetBrightnessAll(Brightness, bool Delayed = true) Configures the brightness value of all LEDs
  • SetBrightness(LedNo, Brightness, Delayed = true) Configures the brightness value of a specific LED
  • GetColor(LedNo) Returns the color value of a specific LED
  • GetBrightness(LedNo) Returns the brightness value of a specific LED
  • Write() Writes the status of all LEDs

Properties

  • LedCount Returns the amount of LEDs in the chain

How to connect without Chip Select

Toolbox_NETMF_Hardware_Lpd8806Chain.png

How to connect with Chip Select

Toolbox_NETMF_Hardware_Lpd8806Chain-cs.png

Sample code in C#

// There's a 1M strip (32 LEDs) connected to the first SPI bus on the Netduino
RgbLedStrip Chain = new RgbLedStrip(RgbLedStrip.Chipsets.LPD8806, 32, SPI_Devices.SPI1);

// Shows a red, green and blue LED
Chain.SetColor(0, 0xff0000);
Chain.SetColor(1, 0x00ff00);
Chain.SetColor(2, 0x0000ff);
Chain.Write();

// Just changing colors
Chain.SetColorAll(0xff0000, true);
Chain.SetColorAll(0x00ff00, true);
Chain.SetColorAll(0x0000ff, true);

Sample code in VB

' There's a 1M strip (32 LEDs) connected to the first SPI bus on the Netduino
Dim Chain As RgbLedStrip = New RgbLedStrip(RgbLedStrip.Chipsets.LPD8806, 32, SPI_Devices.SPI1)

' Shows a red, green and blue LED
Chain.SetColor(0, &HFF0000)
Chain.SetColor(1, &HFF00)
Chain.SetColor(2, &HFF)
Chain.Write()

' Just changing colors
Chain.SetColorAll(&HFF0000, True)
Chain.SetColorAll(&HFF00, True) 
Chain.SetColorAll(&HFF, True)

Related documents

Last edited Jan 1, 2013 at 9:16 PM by Garrcomm, version 3