Just some experiments using fastleds ;) https://instagram.com/p/7JCGTOrLQL/?taken-by=jonasvorwerk

Just some experiments using fastleds :wink:
https://instagram.com/p/7JCGTOrLQL/?taken-by=jonasvorwerk

Real cool man. I love the patterns. Are you willing to reveal your secret code? I’m curious how it generates the random horizontal/vertical planes and shifts them. Real neat

This is how I move a line:

void move_up(){
for( byte y = 0; y < ROWS; y++) {
for( byte x = 0; x < COLS; x++) {
if(y > 0) {
leds[ XY(x, y-1)] = leds[ XY(x, y)];
leds[ XY(x, y)].fadeToBlackBy(fadeouttime);
}
}
}
}

how to draw a line:
void line(){
move_up();
EVERY_N_MILLISECONDS( 1000) {
for( byte x = 0; x < COLS; x++) {
leds[ XY(x, (ROWS-1))] = CHSV(hue,sat,val);
}
}
}

and to be able to use x,y:
uint16_t XY(uint8_t x, uint8_t y){
uint16_t i;
if( serpentinelayout == false) {
i = (y * COLS) + x;
}
if( serpentinelayout == true) {
if( y & 0x01) {
uint8_t reverseX = (COLS - 1) - x;
i = (y * COLS) + reverseX;
}
else {
i = (y * COLS) + x;
}
}
return i;
}

The demoreel100 is a great start, just add some random variables :wink:

Thanks man! But out of context I’ll never figure it out. Lol.
I’m too new yet but I’m learning.
I’ve been poking around a little and I’m getting some stuff done. But I’ve got a long way to go to make awesome stuff like this.
That display would work a treat in my son’s cardboard rocket ship. Lol

Try this out:

#include <FastLED.h>

#define ROWS 4
#define COLS 8
#define NUM_LEDS ROWS*COLS
#define DATA_PIN 11
#define CLOCK_PIN 13

CRGB leds[NUM_LEDS];

uint8_t hue = 183;
uint8_t sat = 128;
uint8_t val = 255;
uint8_t fadeouttime = 100;
uint8_t varHorizontal = 100;
boolean vertical = true;
const bool serpentinelayout = false;

void setup() {
delay(2000);
FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

void loop() {
hue++;
//knightrider();
FastLED.show();
delay (20);
}

uint16_t XY(uint8_t x, uint8_t y){
uint16_t i;
if( serpentinelayout == false) {
i = (y * COLS) + x;
}
if( serpentinelayout == true) {
if( y & 0x01) {
uint8_t reverseX = (COLS - 1) - x;
i = (y * COLS) + reverseX;
}
else {
i = (y * COLS) + x;
}
}
return i;
}

void knightrider(){
fadeToBlackBy( leds, NUM_LEDS, fadeouttime);
if(vertical) {
int pos = beatsin16(varHorizontal,0,ROWS);
for( byte y = 0; y < COLS; y++) {
leds[ XY(y, pos)] = CHSV( hue, sat, val);
}
} else {
int pos = beatsin16(varHorizontal,0,COLS);
for( byte y = 0; y < ROWS; y++) {
leds[ XY(pos, y)] = CHSV( hue, sat, val);
}
}
}

That’s definitely cool… thanks and very useful.
But… it’s not quite as awesome as the routines in the video… lol

I piled a bunch of routines on top of another and I see where you’re taking me on this. Neat stuff this library!