Simplifying control of LED 2801 square pixel

Hi KirAsh4,

If I may ask another question or two...

So I've had a go at putting the basic code together for a predefined set of LEDs to switch on, as per your suggestions... i hope.

I'm trying to figure out how to 'group' a set of LEDs so that I can control, for example, 5 modules at once. Is it an array that I need to create? Such as this:

LED led[group name] = {LED(2), LED(20), LED(47), LED(60)};

Essentially, where I'm heading for is that these 4 LEDs light up in blue, whilst all unspecified LEDs remain white, for example. And then another set of LEDs light up in blue, and the remaining 75 go white. All dependent upon the XML data feed from elsewhere (that bits for later).

I appreciate there must be ws2801 snippets/examples out there that I can find to build around - I will continue to hunt for them – but no success yet, most likely due to my level of understanding. Any pointers or examples very much appreciated.

Thanks again,

T

P.S. This is the code I have put together so far:

#include <FastSPI_LED.h>

#define NUM_LEDS 80

// Sometimes chipsets wire in a backwards sort of way
struct CRGB { unsigned char b; unsigned char r; unsigned char g; };
// struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
struct CRGB *leds;

#define PIN 4

void setup()
{
FastSPI_LED.setLeds(NUM_LEDS);
FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2801);
FastSPI_LED.setPin(PIN);

FastSPI_LED.init();
FastSPI_LED.start();

leds = (struct CRGB*)FastSPI_LED.getRGBData();
}

void loop() {

//work out how to switch on/off groups - HIGH/LOW?,
//how to group different sets of LEDs - arrays?
//how to control the other 76 LEDs as one group as simply as possible
//how to fade in/out

leds[2].r = 255;
leds[2].g = 255;
leds[2].b = 255;
FastSPI_LED.show();
delay(3);
leds[20].r = 255;
leds[20].g = 255;
leds[20].b = 255;
FastSPI_LED.show();
delay(3);
leds[47].r = 255;
leds[47].g = 255;
leds[47].b = 255;
FastSPI_LED.show();
delay(3);
leds[60].r = 255;
leds[60].g = 255;
leds[60].b = 255;
FastSPI_LED.show();
delay(3);
}