Break Stuff
Active member
I'm using Teensy 3.2, Teensyduino 1.36, Arduino 1.8.1, PJRC Propshield, APA102 leds, and FastLed 3.1.3
I can find no combination of settings that allow playFlashRaw and FastLED to work at the same time.
as soon as "FastLED.addLeds<>" is called playFlashRaw will not work. Comment it out and playFlashRaw works just fine.
Code with file:
I can find no combination of settings that allow playFlashRaw and FastLED to work at the same time.
as soon as "FastLED.addLeds<>" is called playFlashRaw will not work. Comment it out and playFlashRaw works just fine.
Code with file:
Code:
/******************************* LEDS */
#include <FastLED.h>
#define NUM_LEDS 8
CRGB leds[NUM_LEDS];
/******************************* Audio */
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioPlaySerialflashRaw playFlashRaw1;
AudioMixer4 mixer1;
AudioOutputAnalog dac1;
AudioConnection patchCord1(playFlashRaw1, 0, mixer1, 0);
AudioConnection patchCord2(mixer1, dac1);
void setup() {
/************************************************************ LEDS */
delay(1000);
FastLED.addLeds<APA102, BGR>(leds, NUM_LEDS); // Comment this out and the sounds work
pinMode(7, OUTPUT);
digitalWrite(7, HIGH);
/*********************************************************** Audio */
AudioMemory(20);
pinMode(5, OUTPUT);
mixer1.gain(0, 0.8);
digitalWrite(5, HIGH);
if ( !SerialFlash.begin(6) ) Serial.println("spi failure"); else Serial.println("spi success");
}
void loop() {
/********************************************************************************** LEDS */
for(int n = 0; n < NUM_LEDS; n++) {
leds[n] = CRGB::White;
// SPI.beginTransaction(SPISettings(24000000, MSBFIRST, SPI_MODE0)); //these 4 lines do not help
// digitalWrite(7, HIGH);
FastLED.show();
// digitalWrite(7, LOW);
// SPI.endTransaction();
delay(8);
leds[n] = CRGB::Black;
}
/******************************************************************************* Audio */
Serial.println("start play attempt");
playFlashRaw1.play("rainstickMONO.raw");
delay(5);
while ( playFlashRaw1.isPlaying() );
Serial.println("end play attempt");
}