Driving an LED strip

Hey Everyone. I’m a total newbie with hardware. I wanted to use a Netduino 3 to drive an LED strip (never mind the colors, I just want to be able to address them properly.

The configuration:
Netduino powered through USB
300W/5V/60A Power supply
This LED strip which is supposedly RGBA addressable

I thought the following code would be enough to power exactly 64 LEDs but every time I turn it on I get random rainbow colors:


var spi = new SPI(new SPI.Configuration(Cpu.Pin.GPIO_Pin13,
    false, 0, 0, false, true, 10000, SPI.SPI_module.SPI1));
            byte[] colors = new byte[4 * 64];
            var read = new byte[4 * 64];

            while (true)
            {
                for (int i = 0; i < colors.Length; i ++)
                {
                    colors[i] = 0xFF;
                }

                spi.WriteRead(colors, read, 1);
                Thread.Sleep(100);
            }

Anyone know what might be the deal? Also if this isn’t enough information I’d be happy to provide more.

Have you checked the timing requirements of the LED strip? It looks like this strip uses WS2812B LEDs which look to have similar requirements to the WS2811 LEDs. This is tricky to achieve on the Netduino at the moment.

Adafruit has written a tutorial on how to use these LEDs. It does require that you are able to build the firmware though. The Netduino NETMF 4.3 Firmware has some instruction on how to do this.

Regards,
Mark

Nevyn,
I might try this. I’ll report back with results.

You can drive them direct from managed code with SPI without needing any special firmware.

https://old.ghielectronics.com/community/codeshare/entry/649

2 Likes

This is good. Somehow (after a bit of cord wiggling) I got the LEDs turned on. I think I need a better data signal so I’ll probably turn to soldering at this point.

Thanks for the help!

1 Like