1+ /* *
2+ @title MoonLight
3+ @file EffectsFastLED.h
4+ @repo https://github.com/ewowi/MoonBase, submit changes to this file as PRs
5+ @Authors https://github.com/ewowi/MoonBase/commits/main
6+ @Doc https://ewowi.github.io/MoonBase/general/utilities/
7+ @Copyright © 2025 Github MoonBase Commit Authors
8+ @license GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
9+ @license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] 10+ **/
11+
12+ #include " EffectsFastLED.h"
13+
14+ #include " FastLED.h"
15+ #include " fl/ui.h"
16+ #include " fl/xymap.h"
17+ #include " fx/time.h"
18+
19+ using namespace fl ;
20+
21+ #define HEIGHT 100
22+ #define WIDTH 100
23+ #define SERPENTINE true
24+ #define BRIGHTNESS 255
25+
26+ DEFINE_GRADIENT_PALETTE (firepal){
27+ // define fire palette
28+ 0 , 0 , 0 , 0 , // black
29+ 32 , 255 , 0 , 0 , // red
30+ 190 , 255 , 255 , 0 , // yellow
31+ 255 , 255 , 255 , 255 // white
32+ };
33+
34+ DEFINE_GRADIENT_PALETTE (electricGreenFirePal){
35+ 0 , 0 , 0 , 0 , // black
36+ 32 , 0 , 70 , 0 , // dark green
37+ 190 , 57 , 255 , 20 , // electric neon green
38+ 255 , 255 , 255 , 255 // white
39+ };
40+
41+ DEFINE_GRADIENT_PALETTE (electricBlueFirePal) {
42+ 0 , 0 , 0 , 0 , // Black
43+ 32 , 0 , 0 , 70 , // Dark blue
44+ 128 , 20 , 57 , 255 , // Electric blue
45+ 255 , 255 , 255 , 255 // White
46+ };
47+
48+
49+ XYMap xyMap (HEIGHT, WIDTH, SERPENTINE);
50+
51+
52+ // void FireMatrixEffect::loop() {
53+ // CRGBPalette16 myPal = getPalette();
54+ // uint32_t now = millis();
55+ // TimeWarp timeScale(0, 1.0f);
56+ // timeScale.setSpeed(speedY);
57+ // uint32_t y_speed = timeScale.update(now);
58+ // for (int i = 0; i < HEIGHT; i++) {
59+ // for (int j = 0; j < WIDTH; j++) {
60+ // uint8_t palette_index = getPaletteIndex(now, i, j, y_speed);
61+ // CRGB c = ColorFromPalette(myPal, palette_index, BRIGHTNESS);
62+ // int index = xyMap((HEIGHT - 1) - i, (WIDTH - 1) - j);
63+ // leds[index] = c;
64+ // }
65+ // }
66+ // layerV->setPixelColor(0, CRGB(0,0,0));
67+ // }
68+
69+ // CRGBPalette16 FireMatrixEffect::getPalette() {
70+ // // get palette
71+ // switch (palette) {
72+ // case 0:
73+ // return firepal;
74+ // case 1:
75+ // return electricGreenFirePal;
76+ // case 2:
77+ // return electricBlueFirePal;
78+ // default:
79+ // return firepal;
80+ // }
81+ // }
0 commit comments