Yellow/White strobe pattern

Could anyone help me with a yellow/White pattern that possible has a random strobe/flash pattern? Sort of like the police pattern that’s uploaded.

Sure! DM me directly and I’ll be happy to help. (Police Pattern author).

3 Likes

Here’s the code to implement this request. Enjoy!

// Alternating yellow/white flashing strip lights.
// Lloyd Taylor ltaylor@netelder.com 15 Dec 2020
// version 1.0

firstcolor = 0
timer=0
blinkrate = 400 // rate of flashing in mSec
blocksize = 10 // number of sequential leds in one color

export function beforeRender(delta) {
  timer += delta
  if (timer > blinkrate){
    timer = 0
    if (firstcolor == 0) {
      firstcolor = 0.17
      firstsat = 1
      secondcolor = 0
      secondsat = 0
    }
    else {
      firstcolor = 0
      firstsat = 0
      secondcolor = 0.17
      secondsat = 1
    }
  }  
  
}

export function render(index) {
  if (index/blocksize & 1) {
  	color=firstcolor
  	sat=firstsat
  	}
  else {
  	color=secondcolor
  	sat=secondsat
  }
  hsv(color, sat, 1)
}
4 Likes