Skip to content

Commit 616d4cf

Browse files
committed
correct basic_a2dp-fft-led example to use FFTDisplay
1 parent 5e2f6c0 commit 616d4cf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/examples-basic-api/basic-a2dp-fft-led/basic-a2dp-fft-led.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
BluetoothA2DPSink a2dp_sink;
1919
AudioRealFFT fft; // or any other supported inplementation
20-
LEDOutput led(fft); // output to LED matrix
20+
FFTDisplay fft_dis(fft);
21+
LEDOutput led(fft_dis); // output to LED matrix
2122

2223
// Provide data to FFT
2324
void writeDataStream(const uint8_t *data, uint32_t length) {
@@ -40,11 +41,13 @@ void setup() {
4041
auto lcfg = led.defaultConfig();
4142
lcfg.x = LED_X;
4243
lcfg.y = LED_Y;
43-
lcfg.fft_group_bin = 3;
44-
lcfg.fft_start_bin = 0;
45-
lcfg.fft_max_magnitude = 40000;
4644
led.begin(lcfg);
4745

46+
fft_dis.fft_group_bin = 3;
47+
fft_dis.fft_start_bin = 0;
48+
fft_dis.fft_max_magnitude = 40000;
49+
fft_dis.begin();
50+
4851
// add LEDs
4952
FastLED.addLeds<WS2812B, PIN_LEDS, GRB>(led.ledData(), led.ledCount());
5053

0 commit comments

Comments
 (0)