2 #include "Arduino_LED_Matrix.h"
3 #include "AudioTools/AudioLibs/AudioFFT.h"
4 #include "FFTDisplay.h"
8 struct LEDOutputUnoR4Config;
70 frame.resize(cfg.
x * cfg.
y);
87 bool &
ledXY(uint8_t x, uint8_t y) {
89 return frame[x + (y * cfg.
x)];
95 if (p_vol !=
nullptr) {
99 if (p_fft !=
nullptr) {
100 for (
int j = 0; j < cfg.
x; j++) {
113 for (uint8_t y = 0; y < currY; y++) {
117 for (uint8_t y = currY; y < cfg.
y; y++) {
120 if (x > max_column) max_column = x;
126 if (max_column >= cfg.
x) {
129 if (max_column > cfg.
x - 1) {
130 max_column = cfg.
x - 1;
140 led_matrix.loadPixels((uint8_t *)frame.data(), cfg.
x * cfg.
y);
154 ArduinoLEDMatrix led_matrix;
160 for (
int x = 1; x < cfg.
x; x++) {
161 for (
int y = 0; y < cfg.
y; y++) {
165 for (
int y = 0; y < cfg.
y; y++) {
166 ledXY(cfg.
x - 1, y) =
false;
174 for (
int x = 0; x < cfg->
x; x++) {
176 int currY = matrix->
fftDisplay().getMagnitudeScaled(x, cfg->
y);
177 LOGD(
"x: %d, y: %d", x, currY);
186 int currY = mapT<float>(vol, 0.0,
188 static_cast<float>(cfg->
y));