# Blinkstick square turn off and timing

**URL:** <https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132>\
**Category:** Support\
**Created:** [February 4, 2019, 10:33pm UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132 "2019-02-04T22:33:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 4, 2019, 10:33pm UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/1 "2019-02-04T22:33:38Z")

</div>

In processing what is the correct method to turn off the Blinkstick? and how to adjust the timing between colors?

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 6, 2019, 3:07am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/2 "2019-02-06T03:07:34Z")

</div>

Looks like there is no real support here.

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 6, 2019, 7:20am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/3 "2019-02-06T07:20:09Z")

</div>

maybe someone can explain to me what is the channels and the indexes?or where to find this info?

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 6, 2019, 7:55am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/4 "2019-02-06T07:55:09Z")

</div>

Hey! Which of the BlinkSticks do you have?

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 6, 2019, 9:37am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/5 "2019-02-06T09:37:40Z")

</div>

Blinkstick square. Shall I enter my code. I can only get one led to come on.

---

<div class="post-metadata">

**Author:** ![framtk](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/f/c0e974/32.png) [@framtk](https://forums.blinkstick.com/u/framtk)\
**Post date:** [February 6, 2019, 9:48am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/6 "2019-02-06T09:48:14Z")

</div>

The square is composed of 8 LEDs, if you simply set the color it will turn on only the first LED.  
To turn on different/multiple LEDs you can set the index of the one you want to turn on (from 0 to 7 respectively), to turn it off you can set both red, green and blue values to 0.

To turn them all on or off i cycle through all of them and set the color individually, unfortunately I don’t think there is a way to know the number of LEDs on a stick so I just counted them manually and made the loop cycle 8 iterations (there is a function to get the led count but it returns -1 for the square).

I don’t know if this is the most efficient way but it seems to work fine and by looking at the library I don’t see any other clear way to do it, bare in mind that I had my Blinksticks available since only a few days so I might be missing something very obvious.

I’m not really sure what the channel is used for either, I think is used by the Blinkstick Pro but I don’t have one so I can’t really test it

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 6, 2019, 9:55am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/7 "2019-02-06T09:55:00Z")

</div>

Best way to control BlinkStick Square is by using LED frames. Here is the example:

> <https://github.com/arvydas/blinkstick-processing/blob/master/examples/ProLEDFrame/ProLEDFrame.pde>

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 6, 2019, 10:24am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/8 "2019-02-06T10:24:19Z")

</div>

so this line //Sends to R channel  
device.setColors(0, data);

sends only to red channel.? sorry I am just new to this too.

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 6, 2019, 10:40am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/9 "2019-02-06T10:40:18Z")

</div>

BlinkStick Square is a derivative of BlinkStick Pro which has R=0, G=1 and B=2 channels to send digital data to LEDs. BlinkStick Square uses only R=0 channel for LED data transfers. For Square always use channel 0 to send data to the device.

If you want to know more about BlinkStick Pro and channels, you can find a bit more info in this tutorial:

[https://www.blinkstick.com/help/tutorials/blinkstick-pro-adafruit-neopixel-matrices](https://www.blinkstick.com/help/tutorials/blinkstick-pro-adafruit-neopixel-matrices)

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 6, 2019, 11:10am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/10 "2019-02-06T11:10:23Z")

</div>

what about the turn off? The device.turnOff() method doesnt seem to work.

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [February 6, 2019, 11:22am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/11 "2019-02-06T11:22:40Z")

</div>

For now, just send an LED frame with all 0, will have the turnOff feature fixed.

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 7, 2019, 8:40am UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/12 "2019-02-07T08:40:14Z")

</div>

I added this code to turn it off; //switch off  
byte[] data = new byte[leds \* 3];  
for (int i = 0; i \< data.length; i++)  
{  
data[i] = (byte)(0);  
}

device.setColors(0, data);

---

<div class="post-metadata">

**Author:** ![angelconch2](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@angelconch2](https://forums.blinkstick.com/u/angelconch2)\
**Post date:** [February 7, 2019, 11:29pm UTC](https://forums.blinkstick.com/t/blinkstick-square-turn-off-and-timing/1132/13 "2019-02-07T23:29:55Z")

</div>

```
 In line 28 of above it says data[i] = (byte)random(128);

```

How do I actually set a color . data[i] = (byte)color(128);? or byte(128);  
but it only sets a byte whereas a color needs 3 bytes like (128,0,0)? doesnt it? are they consecutive bytes? I am bit confused. I thought this would be easy.
