Addressable LED pixel group

Hey Everyone.

I am having a problem trying to code my Addressable LED project. I am using an arduino uno and all the wiring is set up.

I am trying to declare an array of 11 panels each with 10 LED Pixels. Each panel is one pentagon which makes up a dodecahedron. I need each panel to be one solid color. I have been able to get a for loop going but only for 1 panel at a time and I need to call each panel individually later on in my code. Any help would be grateful.

Thank you for your support.

Any help would be grateful.

Could say the same thing.

What parts are you using?
How is it wired up?
Can you post the code ( using the </> icon ) that you are using?

Sorry It was late and I neglected that information.
2 Addressable RGB 60-LED Strip, 5V, 2m (WS2812B) from pololu and I am using the Adafruit_NeoPixel code to drive my script.

I have cut the strip down to 2 LED’s strips so I could bend them into the pentagon 5 sided shape, so there are 10 LED’s per shape.

#include <Adafruit_NeoPixel.h>
      
#define PIN 6

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(120, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  Serial.begin(9600);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

}

void loop() {
  // put your main code here, to run repeatedly:
turnPanelOn(0);

}
    void turnPanelOn (int panel) {
    for (int i = (panel * 10); i < (panel*10) + 10; i++){
    strip.setPixelColor(i, 0, 255, 0);
 strip.show();
   }

}

so there are 10 LED’s per shape.

But your code says there are 120 LEDs

I am trying to declare an array of 11 panels each with 10 LED Pixels.

What do you mean by declare?

Are the strips chained together?

I would let the turnPanelOn function have a colour passed to it.

    void turnPanelOn (int panel, byte r, byte g, byte b) {

    for (int i = (panel * 10); i < (panel*10) + 10; i++){
    strip.setPixelColor(i, r, g, b);
     }
       strip.show();
   }

Only call strip.show when you have set all the LEDs you want to change at that time.

when I say declare I mean I want to be able to have a intigre named panel_01 which contains (0-9 LEDs) or Panel_02 which contains (10 - 19 LEDs). The strips are chained together. It is effectively still the strip.

Perhaps if I explain my whole project it might shed some light on what I am trying to achieve.

As I said before I have 12 panels that make up a dodecahedron. each panel has 10 lights and in the centre of the shape is a pressure switch that has been knitted from smart fabric. I need to have each panel at 0 RGB or off, until I press the fabric. Based on the pressure from the switch the lights for that panel will turn on.

I don't see your problem. That function will address the 10 LEDs of each individual shape. Just call it with a number 0 to 9 to get what shape you need.

What exactly do you want to do differently to what you are doing. If you just want to code using names and not numbers then do a hash define at the start of your code.

#define panel_01 0
#define panel_02 1
.....
// and so on

Thanks for your help I that has actually flipped a switch in my apparently slow head haha I think I might have been over thinking things.