Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void vizualiser(){
- bool newReading = MSGEQ7.read(EQ7interval); // Look for new reading
- if (newReading) {
- FastLED.clear();
- for(int s = 0; s < LEDstrips/2; s++){ // For each fq
- uint8_t fq = MSGEQ7.get(s); // Get reading
- fq = mapNoise(fq, nz, 255, 0, 255); // Reduce noise
- fq = map(fq, 0, 255, 0, LEDper); // Scale values to length of strips
- for(int l = 0; l < fq; l++){ // Write values
- leds[s][l].setHSV(hue+l*5, 255, 255);
- leds[13-s][l].setHSV(hue+l*5, 255, 255);
- if(fq > EQ7max[s]) { // Rescale maximums
- EQ7max[l] = fq;
- } else {
- EQ7reset[l]++;
- if(EQ7reset[l] = 255){
- EQ7max[s] = fq;
- // EQ7reset++;
- }
- }
- }
- }
- FastLED.show();
- hue++;
- }
- delay(30);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement