Quick matrix proof of concept
Because I’m lazy I just coiled 4m strip arround a transparent tube inside the diffusor/screen. I’m pretty happy with my “360 angular degree spiral backpro matrix”…
In case someone wonders about the sketch - here it is:
/* 20 * 12 Spiralmatrix @ WS2811 */
#include <FastLED.h>
// LED stuff
#define LED_PIN 23
#define COLOR_ORDER GRB
#define CHIPSET WS2811
#define BRIGHTNESS 255
const uint8_t WIDTH = 20;
const uint8_t HEIGHT = 12;
#define NUM_LEDS (WIDTH * HEIGHT)
CRGB leds[NUM_LEDS];
// Timer stuff
struct timer {unsigned long takt; unsigned long lastMillis; unsigned long count; int delta; byte up; byte down;};
timer multiTimer[5];
int timers = sizeof( multiTimer ) / sizeof( multiTimer[0] );
void setup()
{
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness( BRIGHTNESS );
//Serial.begin(9600);
for (int i = 0; i < timers; i++) multiTimer[i].delta = 1;
multiTimer[0].takt= 5; //x1
multiTimer[0].up = WIDTH - 1;
multiTimer[0].down = 0;
multiTimer[1].takt= 82; //y1
multiTimer[1].up = HEIGHT - 1;
multiTimer[1].down = 0;
multiTimer[2].takt= 33; //x2
multiTimer[2].up = WIDTH - 1;
multiTimer[2].down = 0;
multiTimer[3].takt= 10; //y2
multiTimer[3].up = HEIGHT - 1;
multiTimer[3].down = 0;
multiTimer[4].takt= 20; //color
multiTimer[4].up = 255;
multiTimer[4].down = 0;
}
void loop()
{
UpdateTimers();
DimmAll();
//MoveAll();
NewPixels();
FastLED.show();
//showTimers();
}
void UpdateTimers() // counts everything up and down, when the time is right
{
unsigned long now=millis();
for (int i=0; i < timers; i++)
{
while (now-multiTimer[i].lastMillis >= multiTimer[i].takt)
{
multiTimer[i].lastMillis += multiTimer[i].takt;
multiTimer[i].count = multiTimer[i].count + multiTimer[i].delta;
if (multiTimer[i].count == multiTimer[i].up) {multiTimer[i].delta = -multiTimer[i].delta;}
if (multiTimer[i].count == multiTimer[i].down) {multiTimer[i].delta = -multiTimer[i].delta;}
}
}
}
void showTimers() // just for debugging
{
for (int i=0;i<timers;i++)
{
Serial.print(multiTimer[i].count);
Serial.print(‘\t’);
}
Serial.println();
}
uint16_t XY( uint8_t x, uint8_t y) // maps the matrix to the strip
{
uint16_t i;
i = (y * WIDTH) + x;
return i;
}
void NewPixels() // the “emitter”
{
leds[ XY(multiTimer[0].count, multiTimer[1].count)] += CHSV( multiTimer[4].count, 255, 255);
leds[ XY(multiTimer[2].count, multiTimer[3].count)] += CHSV( 1, 255, 255);
}
void DimmAll() // fades all a bit down
{
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i].nscale8(250);
}
}
void MoveAll() // rotates the stuff
{
for(int i = 0; i < NUM_LEDS - 1; i++)
{
leds[i] = (leds[i] + leds[i+1]) / 2;
}
}