Accessing all WS2812b LEDs at once

Hi ‘guys’

Im using Visual studio and want to build a project in C#. I have no programming experience at all BTW so talk to me like an absolute noob. I want to address all the LEDs (NeoPixel/WS2812b) at the same time. I have managed to do this very easily with python. Can you give me some tips or post some example code? Essentially i want several buttons in a GUI which when pressed will show that color. Sounds simple - My mind is blown with how complex this is. Im great with hardware - Programming is a little above me. So far in Visual Studio I have managed to access the blinkstick and display its serial number. I have a button that when clicked turns one Led red. My issue is that it only turns on one LED. I want to be able to access them all.

Any help will be kindly received

Glyn.

Hey Glyn,

are you using HidLibrary with C# to control the device?
Your HidStream has the SetFeature method.
Take a look at this:
SetFeature(new byte[2] {0x04, M});
M is the mode. You have to set it to Mode 2.
SetFeature(new byte[6] {0x05, 0x00,L, R,G,B});
L is for the LED you want to control, R,G,B for the colors.

Hope it helps a bit

To be honest i have no idea what you have just said lol. Im trying to start again from scratch. I have downloaded Blinkstickdotnet - master and opened the file blinkstickdonet in visual studio. What exactly need to do to get all colours light up? Or should i open examples?

For Blinstickdotnet the IndexedColor Example should help.

Perfect - So that does what i want. Now how would i make only that happen when a button is pressed?

Hey,

I´ve changed the example to a WinForm with a button. You can download it here:

It´s is very dirty, I don´t have time for more at the moment.

But now I think you need to practice C# first… It is essential to use Blinkstick and it´s librarys this way.

Good luck :smile:

You sir are a gentlemen (I’m assuming your a gent but i apologise if not) - The last thing - I keep getting an error saying blinkstickdotnet could not be found. Everything was working perfectly until i saved my work.

I´m just an ordinary man :smile: .

Please keep sure that everything is in your folder \IndexedColors\bin\Debug, means BlinkStickDotNet.dll and also Hidlibrary.dll and LibUsbDotNet.dll. Keep also sure that it compiles the IndexedColors.exe there.
Maybe you have to change your project folder, my folder was “E:\BlinkStickDotNet-master\Examples\BlinkStickPro\IndexedColors” but it will not work in your environment.

I´m using SharpDevelop, it´s a bit different from VisualStudio.

Hope it helps.

Check the references section and make sure that the assembly is referencing BlinkStickDotNet.