/*
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() {
uint16_t a = millis();
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 64; j++) {
leds[XY(4 - i, 63 - j)] = ColorFromPalette(HeatColors_p, qsub8(inoise8(i * 60, j * 60 + a*2, a / 3), abs8(j - 63) * 255 / 63), BRIGHTNESS);
}
}
LEDS.show();
}
uint16_t XY (int x, int y) { return (x*64+y);}