diff --git a/include/effect_matrix.h b/include/effect_matrix.h index 838e9b7..56b08fb 100644 --- a/include/effect_matrix.h +++ b/include/effect_matrix.h @@ -5,6 +5,7 @@ #include "Effect.h" #include "config.h" #include "my_fastled.h" +#include "my_color_palettes.h" class MatrixEffectColumn { private: diff --git a/include/my_color_palettes.h b/include/my_color_palettes.h new file mode 100644 index 0000000..09baead --- /dev/null +++ b/include/my_color_palettes.h @@ -0,0 +1,8 @@ +#pragma once +#include "my_fastled.h" + +//CRGBPalette16 palette_fire; +//CRGBPalette16 palette_matrix; + +extern const TProgmemRGBGradientPalette_byte palette_fire[] FL_PROGMEM; +extern const TProgmemRGBGradientPalette_byte palette_matrix[] FL_PROGMEM; diff --git a/src/color_palettes.cpp b/src/color_palettes.cpp new file mode 100644 index 0000000..9f3c7dc --- /dev/null +++ b/src/color_palettes.cpp @@ -0,0 +1,12 @@ +#include "my_color_palettes.h" + +__attribute__ ((aligned(4))) extern const TProgmemRGBGradientPalette_byte palette_fire[] FL_PROGMEM = { + 0, 0, 0, 0, //black +128, 255, 0, 0, //red +224, 255,255, 0, //bright yellow +255, 255,255,255 }; //full white + +__attribute__ ((aligned(4))) extern const TProgmemRGBGradientPalette_byte palette_matrix[] FL_PROGMEM = { + 0, 0, 0, 0, // black +200, 0,255, 0, // green +255, 255,255,255 }; // white diff --git a/src/effect_matrix.cpp b/src/effect_matrix.cpp index 33245d3..57b3fc8 100644 --- a/src/effect_matrix.cpp +++ b/src/effect_matrix.cpp @@ -1,9 +1,11 @@ #include "effect_matrix.h" +#include "my_color_palettes.h" #include "functions.h" -MatrixEffectColumn::MatrixEffectColumn() { } +MatrixEffectColumn::MatrixEffectColumn() { +} -MatrixEffectColumn::MatrixEffectColumn(Window* win, int xPos) { +MatrixEffectColumn::MatrixEffectColumn(Window* win, int xPos) : MatrixEffectColumn() { window = win; x = xPos; start(); @@ -24,11 +26,7 @@ void MatrixEffectColumn::advance() { void MatrixEffectColumn::draw() { for(int i=0; i