/*
3D Led Cube Planes FastLED example
Copyright (C) 2020 Uri Shaked.
Released under the terms of the MIT license.
*/
#include "FastLED.h"
// LEDs pin
#define DATA_PIN 3
// LED brightness
#define BRIGHTNESS 255
#define NUM_LEDS 320
CRGBArray<NUM_LEDS>leds;
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
Serial.begin(115200);
}
void loop() {
oneup(0,63);
onedown(191,128);
oneup(256,319);
onedown(127,64);
oneup(192,255);
onedown(63,0);
oneup(128,191);
onedown(319,256);
oneup(64,127);
onedown(255,192);
}
void oneup(int start,int finish){
for (int i=start;i<=finish;i++){
leds%=254;
leds.blur1d(64);
leds[i].setHue(millis()/8);
FastLED.show();
}
}
void onedown(int start,int finish){
for (int i=start;i>=finish;i--){
leds%=254;
leds.blur1d(64);
leds[i].setHue(millis()/8);
FastLED.show();
}
}