@@ -18,8 +18,7 @@ void volumeLEDOutputUnoR4(LEDOutputUnoR4Config *cfg, LEDOutputUnoR4 *matrix);
1818 * @author Phil Schatzmann
1919 */
2020struct LEDOutputUnoR4Config {
21- // / Custom callback logic to update the LEDs - by default we use
22- // / fftLEDOutputUnoR4()
21+ // / Custom callback logic to update the LEDs when update() is called
2322 void (*update_callback)(LEDOutputUnoR4Config *cfg,
2423 LEDOutputUnoR4 *matrix) = nullptr ;
2524 // / Update the leds only ever nth call
@@ -28,29 +27,32 @@ struct LEDOutputUnoR4Config {
2827 int x = 12 ;
2928 // / Number of LEDs in a column
3029 int y = 8 ;
30+ // / when true 0,0 is in the lower left corder
3131 bool y_mirror = true ;
3232 // / Influences the senitivity
3333 int max_magnitude = 700 ;
3434};
3535
3636/* *
37- * @brief LEDOutputUnoR4 using the FastLED library. You write the data to the
38- * FFT Stream. This displays the result of the FFT to a LED matrix.
37+ * @brief LED output using the R4 LED matrix library.
3938 * @ingroup io
4039 * @author Phil Schatzmann
4140 */
4241class LEDOutputUnoR4 {
4342
4443 public:
44+ // / @brief Default Constructor
4545 LEDOutputUnoR4 () = default ;
4646
47- // / @brief Default Constructor
47+ // / @brief Constructor for FFT scenario
4848 // / @param fft
4949 LEDOutputUnoR4 (FFTDisplay &fft) {
5050 p_fft = &fft;
5151 cfg.update_callback = fftLEDOutputUnoR4;
5252 }
5353
54+ // / @brief Constructor for VolumeOutput scenario
55+ // / @param vol
5456 LEDOutputUnoR4 (VolumeOutput &vol) {
5557 p_vol = &vol;
5658 cfg.update_callback = volumeLEDOutputUnoR4;
@@ -59,6 +61,7 @@ class LEDOutputUnoR4 {
5961 // / Provides the default config object
6062 LEDOutputUnoR4Config defaultConfig () { return cfg; }
6163
64+ // / Starts the processing with the default configuration
6265 bool begin () { return begin (defaultConfig ()); }
6366
6467 // / Setup Led matrix
@@ -70,8 +73,7 @@ class LEDOutputUnoR4 {
7073 return true ;
7174 }
7275
73- // / Updates the display by calling the update callback method: call this
74- // / method in your loop
76+ // / Updates the display by calling the update callback method: call this method in your loop
7577 virtual void update () {
7678 if (cfg.update_callback != nullptr && count++ % cfg.update_frequency == 0 ) {
7779 // use custom update logic defined in config
@@ -85,7 +87,7 @@ class LEDOutputUnoR4 {
8587 return frame[x + (y * cfg.x )];
8688 }
8789
88- // / @brief Provodes the max magnitude
90+ // / Provodes the max magnitude for the VolumeOutput and FFT scenario
8991 virtual float getMaxMagnitude () {
9092 // get magnitude from
9193 if (p_vol != nullptr ) {
@@ -128,14 +130,15 @@ class LEDOutputUnoR4 {
128130 setColumnBar (max_column, currY);
129131 }
130132
131- // / Provides access to the actual config object. E.g. to change the update
132- // / logic
133+ // / Provides access to the actual config object. E.g. to change the update logic
133134 LEDOutputUnoR4Config &config () { return cfg; }
134135
136+ // / Update the led_matrix
135137 void display () {
136138 led_matrix.loadPixels ((uint8_t *)frame.data (), cfg.x * cfg.y );
137139 }
138140
141+ // / Provides access to the FFTDisplay object
139142 FFTDisplay& fftDisplay () {
140143 return *p_fft;
141144 }
0 commit comments