After some hours on deleting lines in my Code I have found the problem. The problem are the number of leds. When I use in the example code for num_leds 3 everything works fine, but when i use 40 up to 200, the leds have flickering. I use Teensy 3.1 96 Mhz with fastled 3.1 Audio Shield and the Audio Wave player code and I have no idea why it makes these problems! Interesting is, that when the music doesnt play at the beginning the effect is slower than when the music plays…
@Mark_Kriegsman @Daniel_Garcia @PaulStoffregen
#include <FastLED.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#define NUM_LEDS 200
CRGB leds[NUM_LEDS];
// GUItool: begin automatically generated code
AudioPlaySdWav playWav1; //xy=154,78
AudioOutputI2S i2s1; //xy=334,89
AudioConnection patchCord1(playWav1, 0, i2s1, 0);
AudioConnection patchCord2(playWav1, 1, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=240,153
// GUItool: end automatically generated code
void setup() {
Serial.begin(9600);
FastLED.addLeds<TM1809, 5, RGB>(leds, NUM_LEDS);
FastLED.setBrightness(20);
AudioMemory(5);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
SPI.setMOSI(7);
SPI.setSCK(14);
if (!(SD.begin(10))) {
// stop here, but print a message repetitively
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
}
void playFile(const char *filename)
{
playWav1.play(filename);
delay(5);
}
uint8_t a = 0;
void loop() {
leds[0] = CHSV(a, 255, 255);
a++;
leds[1] = CHSV(0, 255, a);
FastLED.show();
FastLED.delay(1);
EVERY_N_SECONDS(20)
{
playFile("SDTEST2.WAV");
}
}
Any other solution to fix this?