maybe you already know the pixelstick : thepixelstick.com/ but i would like to do my own with a much higher led density 144/meter in my case and 200/1,8m So the quality will be much better i am using an arduino due and a LCD TFT touchscreen with build in SD breakout. so i found something but with another led driver : the LPD8806 so i am interested in this line especially : i saw a guy using this in order to draw on the ledstrip : ledStrip.setPixelColor(j, strip.Color(colorred,colorgreen,colorblue));
strip.Color(colorred,colorgreen,colorblue) is used to define a new color the type is rgb_color
strip.setPixelColor : with two parameter is used to set the j led to the right color
As on the pololu led driver we have to write all the time this if i understood correctly : ledStrip.write(colors, LED_COUNT);
So how can i manage to do what i really need if you want to see all the function that i am using is :
[code]#define BUFFPIXEL 20
void bmpdraw(File f, int x, int y, int TFTchoose) {
f.seek(bmpImageoffset);
uint32_t time = millis();
uint16_t p;
uint8_t g, b;
int i, j;
maxColors = 0;
uint8_t sdbuffer[3 * BUFFPIXEL]; // 3 * pixels to buffer
uint8_t buffidx = 3*BUFFPIXEL;
//Serial.print("rotation = "); Serial.println(tft.getRotation(), DEC);
//set up the โdisplay windowโ
//Serial.print("bmp width: ");
//Serial.println(bmpWidth);
//Serial.print("bmp height: ");
//Serial.println(bmpHeight);
if (TFTchoose == 1){
tft.setAddrWindow(x, y, x+bmpWidth-1, y+bmpHeight-1);
uint8_t rotback = tft.getRotation();
} else {
x = 0;
y = 0;
}
//tft.setRotation();
for (i=x; i< bmpHeight+x; i++) {
// bitmaps are stored with the BOTTOM line first so we have to move โupโ
maxColorscount = 0;
for (j=y; j<bmpWidth+y; j++) {
// read more pixels
if (buffidx >= 3*BUFFPIXEL) {
f.read(sdbuffer, 3*BUFFPIXEL);
buffidx = 0;
}
// convert pixel from 888 to 565
b = sdbuffer[buffidx++]; // blue
g = sdbuffer[buffidx++]; // green
p = sdbuffer[buffidx++]; // red
maxColorscount = maxColorscount + b + g + p;
colorred = (int)p/2;
colorgreen = (int)g/2;
colorblue = (int)b/2;
/*
Serial.print(". B: ");
Serial.print(colorblue,DEC);
Serial.print(", G: ");
Serial.print(colorgreen,DEC);
Serial.print(", P: ");
Serial.println(colorred,DEC);
*/
p >>= 3;
p <<= 6;
g >>= 2;
p |= g;
p <<= 5;
b >>= 3;
p |= b;
//Serial.print(p, HEX);
// write out the 16 bits of color
if (TFTchoose == 1){
tft.drawPixel(i, j, p);
} else {
strip.setPixelColor(j, strip.Color(colorred,colorgreen,colorblue));
};
}
if (TFTchoose == 1){
if (maxColorscount >= maxColors) {
maxColors = maxColorscount;
}
} else {
turnallledoff();
delay(12);
};
}
//Serial.print(millis() - time, DEC);
//Serial.println(" ms");
if (TFTchoose == 0){
turnallledoff();
delay(10);
};
}[/code]
thanks you so much for your help in advance and feel free to help and all optimisation you can think of