# Blinkfade in Cube Frame

**URL:** <https://forum.electromage.com/t/blinkfade-in-cube-frame/1280>\
**Category:** Show and Tell\
**Created:** [June 3, 2021, 3:54pm UTC](https://forum.electromage.com/t/blinkfade-in-cube-frame/1280 "2021-06-03T15:54:47Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![pixie](https://forum.electromage.com/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@pixie](https://forum.electromage.com/u/pixie)\
**Post date:** [July 2, 2021, 12:28pm UTC](https://forum.electromage.com/t/blinkfade-in-cube-frame/1280/13 "2021-07-02T12:28:11Z")

</div>

Here’s a quick-and-dirty PB port of the .INO…

```
delayFor = 5000; // How long before the pattern starts
displayFor = 200; // How long each LED stays lit

export var initialDelay = delayFor;
export var whichLED = 0;

totalTime = 0;
export function beforeRender(delta) { 
  if (initialDelay > 0) initialDelay -= delta;
  else {
    totalTime += delta; 
    if (totalTime > displayFor) {
      totalTime = 0;
      whichLED++;
      if (whichLED > pixelCount) {
        initialDelay = delayFor;
        whichLED = 0;
      }
    }
  }    
}

export function render(index) {
  if ((initialDelay < 0) && (index == whichLED)) rgb(1,1,1);
  else rgb(0,0,0);
}

```

EDIT: took a second look and noticed that the pattern repeats.

---

_[View the full topic](https://forum.electromage.com/t/blinkfade-in-cube-frame/1280)._
