87#define MAX_DIMENSION \
88 ((kMatrixWidth > kMatrixHeight) ? kMatrixWidth : kMatrixHeight)
105void Line(
int x0,
int y0,
int x1,
int y1,
byte color);
106void Pixel(
int x,
int y,
byte color);
121void Copy(
byte x0,
byte y0,
byte x1,
byte y1,
byte x2,
byte y2);
144void Scale(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
213void Line(
int x0,
int y0,
int x1,
int y1,
byte color) {
214 int dx = abs(x1 - x0), sx = x0 < x1 ? 1 : -1;
215 int dy = -abs(y1 - y0), sy = y0 < y1 ? 1 : -1;
216 int err = dx + dy, e2;
219 if (x0 == x1 && y0 == y1)
238 for (
int i = 0; i <
NUM_LEDS; i++) {
253 for (
int i = 0; i < 4; i++) {
273 for (
byte band = 0; band < 7; band++) {
275 delayMicroseconds(30);
307 for (
int i = 0; i <
NUM_LEDS; i++) {
308 leds[i].nscale8(value);
326 for (
int x = 0;
x <
WIDTH / 2;
x++) {
350 for (
int x = 0;
x <
WIDTH / 2;
x++) {
362 for (
int x = 0;
x <
WIDTH / 2;
x++) {
387 for (
int x = 1;
x < 8;
x++) {
390 for (
int x = 2;
x < 8;
x++) {
393 for (
int x = 3;
x < 8;
x++) {
396 for (
int x = 4;
x < 8;
x++) {
399 for (
int x = 5;
x < 8;
x++) {
402 for (
int x = 6;
x < 8;
x++) {
405 for (
int x = 7;
x < 8;
x++) {
411 for (
int x = 1;
x < 8;
x++) {
414 for (
int x = 2;
x < 8;
x++) {
417 for (
int x = 3;
x < 8;
x++) {
420 for (
int x = 4;
x < 8;
x++) {
423 for (
int x = 5;
x < 8;
x++) {
426 for (
int x = 6;
x < 8;
x++) {
429 for (
int x = 7;
x < 8;
x++) {
437 for (
int d = r; d >= 0; d--) {
438 for (
int i =
x - d; i <=
x + d; i++) {
441 leds[
XY(i,
y - d)].nscale8(dim);
443 for (
int i =
y - d; i <=
y + d; i++) {
445 leds[
XY(
x + d, i)].nscale8(dim);
447 for (
int i =
x + d; i >=
x - d; i--) {
450 leds[
XY(i,
y + d)].nscale8(dim);
452 for (
int i =
y + d; i >=
y - d; i--) {
454 leds[
XY(
x - d, i)].nscale8(dim);
485 for (
int y = 15;
y > 0;
y--) {
486 for (
int x = 0;
x < 16;
x++) {
494void Copy(
byte x0,
byte y0,
byte x1,
byte y1,
byte x2,
byte y2) {
495 for (
int y = y0;
y < y1 + 1;
y++) {
496 for (
int x = x0;
x < x1 + 1;
x++) {
504 for (
int x = 1;
x < 8;
x++) {
505 for (
int y = 0;
y <
x;
y++) {
513 for (
int x = 1;
x < 8;
x++) {
514 for (
int y = 0;
y <
x;
y++) {
523 for (
int i = 0; i < 8; i++) {
524 for (
int j = 0; j <= i; j++) {
525 Pixel(7 - i, j, i * j * 4);
622 FASTLED_ASSERT(
false,
"breakpoint");
630 for (
int i = 0; i < 16; i++) {
631 for (
int j = 0; j < 16; j++) {
648 Pixel((
p[2] +
p[0]) / 2, (
p[1] +
p[3]) / 2, 50);
665 for (
int i = 1; i < 8; i++) {
666 for (
int j = 0; j < 16; j++) {
679 for (
int i = 0; i < 16; i++) {
680 for (
int j = 0; j < 16; j++) {
705 for (
int i = 0; i < 7; i++) {
708 for (
int i = 0; i < 7; i++) {
736 for (
int i = 0; i < 8; i++) {
739 for (
int i = 8; i < 16; i++) {
749 for (
int i = 0; i < 7; i++) {
768 leds[
XY(random(15), random(15))] =
CHSV(100, 255, 255);
777 for (
int i = 0; i < 7; i++) {
778 Line(2 * i, 16 -
left[i] / 64, 2 * i, 15, i * 10);
779 Line(1 + 2 * i, 16 -
left[i] / 64, 1 + 2 * i, 15, i * 10);
788 for (
int i = 0; i < 7; i++) {
789 Line(2 * i, 16 -
left[i] / 64, 2 * i, 15, i * 10);
790 Line(1 + 2 * i, 16 -
left[i] / 64, 1 + 2 * i, 15, i * 10);
801 for (
int i = 0; i < 7; i++) {
814 for (
int i = 0; i < 7; i++) {
826 for (
int i = 0; i < 7; i++) {
828 i * 27, 255,
right[i] / 3);
840 for (
int i = 0; i < 5; i++) {
841 Line(i, 4 -
left[i] / 256, i, 4, i * 10);
843 Copy(0, 0, 4, 4, 5, 0);
844 Copy(0, 0, 4, 4, 10, 0);
845 Copy(0, 0, 14, 4, 0, 5);
846 Copy(0, 0, 14, 4, 0, 10);
855 for (
int i = 0; i < 5; i++) {
856 Line(i * 2, 4 -
left[i] / 128, i * 2, 4, i * 10);
858 Scale(0, 0, 4, 4, 7, 7, 15, 15);
865void Scale(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3) {
866 for (
int y =
y2;
y < y3 + 1;
y++) {
867 for (
int x =
x2;
x < x3 + 1;
x++) {
869 y0 + ((
y * (y1 - y0)) / (y3 - y1)))];
877 for (
int i = 0; i < 5; i++) {
878 Line(3 * i, 16 -
left[i] / 64, 3 * (i + 1), 16 -
left[i + 1] / 64,
889 for (
int i = 0; i < 5; i++) {
890 Line(3 * i, 16 -
left[i] / 64, 3 * (i + 1), 16 -
left[i + 1] / 64,
899 for (
int i = 0; i < 7; i++) {
910 for (
int i = 0; i < 5; i++) {
911 Line(3 * i, 8 -
left[i] / 128, 3 * (i + 1), 8 -
left[i + 1] / 128,
921 for (
int i = 0; i < 7; i++) {
933 for (
int i = 0; i < 7; i++) {
944 for (
int i = 0; i < 5; i++) {
946 3 * (i + 1), 8 -
left[i + 1] / 128,
956 for (
int i = 0; i < 5; i++) {
958 3 * (i + 1), 8 -
left[i + 1] / 128,
960 Line(15 - (3 * i), 7 +
left[i] / 128,
961 15 - (3 * (i + 1)), 7 +
left[i + 1] / 128,
1002 int ioffset =
scale * i;
1004 int joffset =
scale * j;
1014 int ioffset =
scale2 * i;
1016 int joffset =
scale2 * j;
1042 int ioffset =
scale * i;
1044 int joffset =
scale * j;
1053 for (
int i = 0; i <
p[2]; i++) {
1058 for (
int i = 0; i <
p[1]; i++) {
1070 for (
int i = 0; i <
p[1]; i++) {
1076 for (
int i = 0; i <
p[3]; i++) {
1094 for (
int i = 0; i <
p[0] + 1; i++) {
1106 for (
byte band = 0; band < 7; band++) {
1108 delayMicroseconds(30);
1121 for (
int j = 0; j <
left[1] / 64; j++) {
1127 for (
int j = 0; j <
left[5] / 64; j++) {
1137 for (
int size = 1; size < 200; size++) {
1148 for (
int size = 200; size > 1; size--) {
1162 uint8_t secondHand = (millis() / 1000) % 60;
1163 static uint8_t lastSecond = 99;
1165 if (lastSecond != secondHand) {
1166 lastSecond = secondHand;
1167 if (secondHand == 0) {
1171 if (secondHand == 10) {
1175 if (secondHand == 15) {
1179 if (secondHand == 20) {
1183 if (secondHand == 25) {
1187 if (secondHand == 30) {
1191 if (secondHand == 35) {
1195 if (secondHand == 40) {
1199 if (secondHand == 45) {
1203 if (secondHand == 50) {
1207 if (secondHand == 55) {
1215 for (
int i = 0; i < 16; i++) {
1241 CRGBPalette16(green, green, black, black, purple, purple, black, black,
1242 green, green, black, black, purple, purple, black, black);
1260 for (
int size = 1; size < 100; size++) {
1271 for (
int size = 100; size > 1; size--) {
UISlider speed("Speed", 1.0f, -20.0f, 20.0f, 0.01f)
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
CRGB leds2[lengths[RedStrip]]
TBlendType currentBlending
const TProgmemPalette16 myRedWhiteBluePalette_p
CRGBPalette16 currentPalette
CRGBPalette16 myRedWhiteBluePalette
central include file for FastLED, defines the CFastLED class/object
uint8_t noise[NUM_LAYERS][WIDTH][HEIGHT]
uint8_t noise2[NUM_LAYERS][WIDTH][HEIGHT]
#define MSGEQ7_STROBE_PIN
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
#define TProgmemPalette16
Alias for TProgmemRGBPalette16.
void SetupTotallyRandomPalette()
void SpiralStream(int x, int y, int r, byte dim)
void ChangePalettePeriodically()
void RenderCustomMatrix()
void HorizontalStream(byte scale)
void Pixel(int x, int y, byte color)
void Scale(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM
void FillNoise(uint16_t x, uint16_t y, uint16_t z, uint16_t scale)
void Line(int x0, int y0, int x1, int y1, byte color)
void Copy(byte x0, byte y0, byte x1, byte y1, byte x2, byte y2)
void SetupPurpleAndGreenPalette()
void VerticalStream(byte scale)
void SetupBlackAndWhiteStripedPalette()
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
@ HUE_PURPLE
Purple (270°)
const TProgmemRGBPalette16 RainbowStripeColors_p
HSV Rainbow colors with alternatating stripes of black.
const TProgmemRGBPalette16 CloudColors_p
Cloudy color palette.
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.
LIB8STATIC uint16_t random16()
Generate a 16-bit random number.
LIB8STATIC uint8_t random8()
Generate an 8-bit random number.
#define sin8
Platform-independent alias of the fast sin implementation.
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
@ White
<div style='background:#FFFFFF;width:4em;height:4em;'></div>
@ Gray
<div style='background:#808080;width:4em;height:4em;'></div>
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Representation of an RGB pixel (Red, Green, Blue)