I’m getting a weird interaction between FastLED and ArduinoFHT.
I used the simplest example (fht_adc.pde) added a single strand of ws2812’s and I’m getting an r28 and r29 cannot be used in asm here error when I use the CHSV() or CRGB() calls.
Full code in http://pastebin.com/0i4XmY11, but the offending bit is below
void loop() {
static byte hue = 0;
while(1) { // reduces jitter
cli(); // UDRE interrupt slows this way down on arduino1.0
for (int i = 0 ; i < FHT_N ; i++) { // save 256 samples
while(!(ADCSRA & 0x10)); // wait for adc to be ready
ADCSRA = 0xf5; // restart adc
byte m = ADCL; // fetch adc data
byte j = ADCH;
int k = (j << 8) | m; // form into an int
k -= 0x0200; // form into a signed int
k <<= 6; // form into a 16b signed int
fht_input[i] = k; // put real data into bins
}
fht_window(); // window the data for better frequency response
fht_reorder(); // reorder the data before doing the fht
fht_run(); // process the data in the fht
fht_mag_log(); // take the output of the fht
sei();
/*
// this causes an r28 and r29 cannot be used in asm here error
for(int i = 0;i<numLeds;i++)
{
leds[i] = CHSV(fht_log_out[i],255,255);
LEDS.show();
}
// this causes an r28 and r29 cannot be used in asm here error
for(int i = 0;i<numLeds;i++)
{
leds[i] = CHSV(hue++,255,255);
LEDS.show();
}
*/
// this seems to work fine.
for(int i = 0;i<numLeds;i++)
{
leds[i] = CRGB::Red;
LEDS.show();
}
// this seems to work fine.
for(int i = 0;i<numLeds;i++)
{
Serial.print(fht_log_out[i]);
Serial.print(".");
}
Serial.println();
// send out the data
}
}