Hi, I've been using FastSPI_LED2 with great success with a WS2811 strip of 300

Hi,

I’ve been using FastSPI_LED2 with great success with a WS2811 strip of 300 LEDs. I’ve made a 30x10 display and have hooked up the WiFi Shield in order to grab weather info and current time from my webserver. This is all working fine, but I’ve hit a wall when I tried to get the Micro SD card reader working.

I understand that the Wifi uses pin 10 for SS and the SD slot uses pin 4.

I currently have my strip in Pin 6 and I’m totally stumped.

The script I have works fine when I comment out the LEDS.addLeds line, but as soon as I uncomment it, it just dies.

Any ideas?

Hopefully this will let me post my code.

#include <SD.h>
#include “FastSPI_LED2.h”
#include <avr/pgmspace.h>
#define NUM_LEDS 300
#define BUFFPIXEL 20
CRGB leds[NUM_LEDS];
File bmpFile;
void setup() {
Serial.begin(9600);
LEDS.setBrightness(32);
LEDS.addLeds<WS2811, 6>(leds, NUM_LEDS); //the bad line
delay(10);
pinMode(SS, OUTPUT);
if (!SD.begin(4)) {
Serial.println(“initialization failed!”);
return;
}
Serial.println(“initialization done.”);
bmpDraw(“filetest.bmp”, 0, 0);
}

I’ve been trying on RC2 and have just discovered RC3 but still no joy.

Do you get either of your initialization strings printed out?

Not with the LEDS.addLeds line uncommented. They do print out when it’s commented out though.

And what are you running on?

Arduino Uno R3
IDE 1.0.2 - 1.0.5 hates the Wifi shield.
Official WiFi Shield
FastSPI_LED2 RC3

Can you add prints right after the addLeds, the delay, and the pinMode lines? I’m curious which statement it is that things are stopping at.

Also - do you have any other large buffers defined? You have 2k of ram and 900 bytes of that is eaten up with your led array.

Without having seen any other output or comments, I am sort of suspecting an out-of-memory condition, maybe heap-meets-stack-and-goes-boom. I don’t know how much memory the SD library takes.

One thing to try is to see if you set NUM_LEDS to a much smaller number (eg, 100 instead of 300) if you still have the same results, or if it changes.

Well I’ll be! I changed the LED count down to 10 and the serial outputs displayed. I found 50 was fine, but when I set it to 100, it died again.

Luckily I have a Mega 2560 and I switched it over and now I’m in business.

I’ll post a video of what I’ve been up to soon. I’m going to be doing a presentation on this to the London Arduino group in a few weeks and I’ll be bigging up your work.

You guys are gentlemen of the highest order. Keep up the good work.