RGB High density ledstrip

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 :stuck_out_tongue: So the quality will be much better :smiley: 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 :smiley:

Hello.

That sounds like a neat project! However, I am not sure I understand what you are asking. It sounds like you want a function that sets the color of an individual LED segment. As you mentioned, with our LED strip library, you can call ledStrip.write(colors, LED_COUNT) to update the colors on the LED strip to match those stored in the colors buffer. You should be able to write a function that takes two parameters (the index and the color struct) and changes the color stored in the specified index of your colors buffer to the new color. If that is not what you are asking, could you try rephrasing your question to clarify?

-Brandon