Hi, here a concept, how to map 2 rows to a RGB strip using FastSPI_LED...
/*
* Copyright (C) 2013 Gilad Dayagi. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
/*
* An example for the Arduino particle system library
* A wandering particle that emits colorful smoke
*
* Note: this example uses the colorduino library becuse that is what I had,
* but any device that supports setting a pixel to an RGB value can be used
*/
//#include <Colorduino.h>
#include <FastSPI_LED.h>
#include "ParticleSys.h"
#include "Particle_Std.h"
#include "Particle_Fixed.h"
#include "Emitter_Fountain.h"
#include "PartMatrix.h"
#define NUM_LEDS 20
//change the order of your rgb here
struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
struct CRGB *leds;
const byte numParticles = 50;
boolean pulseOn = false;
Particle_Std particles[numParticles];
Particle_Fixed source;
Emitter_Fountain emitter(0, 0, 5, &source);
ParticleSys pSys(numParticles, particles, &emitter);
PartMatrix pMatrix;
/**
* Render the particles into a low-resolution matrix
*/
void drawMatrix(){
pMatrix.reset();
pMatrix.render(particles, numParticles);
//update the actual LED matrix
for (byte y=0;y<8;y++) {
//for(byte x=0;x<8;x++) {
//Colorduino.SetPixel(x, y, pMatrix.matrix[x][y].r, pMatrix.matrix[x][y].g, pMatrix.matrix[x][y].b);
leds[y].r = pMatrix.matrix[3][y].r;
leds[y].g = pMatrix.matrix[3][y].g;
leds[y].b = pMatrix.matrix[3][y].b;
leds[NUM_LEDS-y].r = pMatrix.matrix[4][y].r;
leds[NUM_LEDS-y].g = pMatrix.matrix[4][y].g;
leds[NUM_LEDS-y].b = pMatrix.matrix[4][y].b;
// }
}
}
void setup()
{
FastSPI_LED.setLeds(NUM_LEDS);
//select your chipset according to your strip type here - have a look at FastSPI documentation
//i´m using a LPD1101 right know who behaves like a LPD6803
FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD6803);
FastSPI_LED.init();
FastSPI_LED.start();
leds = (struct CRGB*)FastSPI_LED.getRGBData();
//Colorduino.Init(); // initialize the board
// compensate for relative intensity differences in R/G/B brightness
// array of 6-bit base values for RGB (0~63)
// whiteBalVal[0]=red
// whiteBalVal[1]=green
// whiteBalVal[2]=blue
//byte whiteBalVal[3] = {36,63,7}; // for LEDSEE 6x6cm round matrix
//Colorduino.SetWhiteBal(whiteBalVal);
randomSeed(analogRead(0));
//source.vx = 3;
//source.vy = 1;
source.x = 112;
source.y = 1;
Emitter_Fountain::minLife = 20;
Emitter_Fountain::maxLife = 80;
Particle_Std::ay = 1;
//PartMatrix::isOverflow = false;
//init all pixels to zero
pMatrix.reset();
}
void loop()
{
pSys.update();
drawMatrix();
FastSPI_LED.show();
delay(20);
}