# Recieving error when trying to SetLedCount

**URL:** <https://forums.blinkstick.com/t/recieving-error-when-trying-to-setledcount/1007>\
**Category:** Support\
**Created:** [July 12, 2018, 7:11pm UTC](https://forums.blinkstick.com/t/recieving-error-when-trying-to-setledcount/1007 "2018-07-12T19:11:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jchande](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jchande](https://forums.blinkstick.com/u/jchande)\
**Post date:** [July 12, 2018, 7:11pm UTC](https://forums.blinkstick.com/t/recieving-error-when-trying-to-setledcount/1007/1 "2018-07-12T19:11:37Z")

</div>

Hi

I have been having issues with a newly purchased BlinkStick Square setting the number of Led’s lit.

This was failing as part of my overall project so I stripped it and tried to simplify by updating an example. But no luck.

```
    static void Main(string[] args)
    {
        Console.WriteLine("Pulse test for BlinkStick.\r\n");
        
        BlinkStick device = BlinkStick.FindFirst();
        device.OpenDevice();

        try
        {
            device.SetLedCount(2);
        }
        catch (Exception ex)
        { Console.WriteLine(ex); }

        {

            device.Pulse("red");
            device.Pulse("green");
            device.Pulse("blue");
        }

```

The error recieved is:

System.IO.IOException: SetFeature failed. —\> System.ComponentModel.Win32Exception: The parameter is incorrect  
— End of inner exception stack trace —  
at HidSharp.Platform.Windows.WinHidStream.SetFeature(Byte[] buffer, Int32 offset, Int32 count) in C:\Code\src\oss\hidsharp\HidSharp\Platform\Windows\WinHidStream.cs:line 134  
at HidSharp.HidStream.SetFeature(Byte[] buffer) in C:\Code\src\oss\hidsharp\HidSharp\HidStream.cs:line 215  
at BlinkStickDotNet.Usb.HidStreamAdapter.\<\>c\_\_DisplayClass6\_0.b\_\_0()  
at BlinkStickDotNet.Usb.HidStreamAdapter.RetryActionOnFail(UInt32 times, Action action)  
at BlinkStickDotNet.Usb.HidStreamAdapter.SetFeature(Byte[] buffer)  
at BlinkStickDotNet.BlinkStick.SetFeature(Byte[] buffer)  
at BlinkStickDotNet.BlinkStick.SetLedCount(Byte count)  
at ConsoleApp6.Program.Main(String[] args) in C:\Users\jchan\Documents\Visual Studio 2017\Projects\ConsoleApp6\ConsoleApp6\Program.cs:line 22

Any ideas?

---

<div class="post-metadata">

**Author:** ![jchande](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jchande](https://forums.blinkstick.com/u/jchande)\
**Post date:** [July 12, 2018, 7:31pm UTC](https://forums.blinkstick.com/t/recieving-error-when-trying-to-setledcount/1007/2 "2018-07-12T19:31:59Z")

</div>

The answer was to setmode(3)
