Address single pixel in an array

ok so the violet pixels are lighting up but not the blue pixes and they arent changing in brightness.

I assume that you have changed the sketch. If so then please post it in a new reply

//chandalure v5

#include <FastLED.h>

#define NUM_STRIPS 5
#define NUM_LEDS_PER_STRIP 2
#define brightness

CRGB leds[NUM_STRIPS] [NUM_LEDS_PER_STRIP];

// pin assignments
 
// states for the state machine
typedef enum
  {
  initialState,
  wantClearLEDS,
  wantVioletStrip1,
  wantBlueStrip1,
  wantVioletStrip2,
  wantBlueStrip2,
  wantVioletStrip3,
  wantBlueStrip3,
  wantVioletStrip4,
  wantBlueStrip4,
  wantVioletStrip5,
  wantBlueStrip5,
  wantDisplay,
  wantReset,
    
  } states;

// state machine variables
states state = initialState;
unsigned long lastStateChange = 0;
unsigned long timeInThisState = 1000;

void setup ()
  {
  FastLED.addLeds<NEOPIXEL, 3>(leds[0], NUM_LEDS_PER_STRIP);
  FastLED.addLeds<NEOPIXEL, 5>(leds[1], NUM_LEDS_PER_STRIP);
  FastLED.addLeds<NEOPIXEL, 6>(leds[2], NUM_LEDS_PER_STRIP);
  FastLED.addLeds<NEOPIXEL, 9>(leds[3], NUM_LEDS_PER_STRIP);
  FastLED.addLeds<NEOPIXEL, 10>(leds[4], NUM_LEDS_PER_STRIP);
  }  // end of setup
        
void doStateChange ()
  {
  lastStateChange = millis ();   
  timeInThisState = 200;

  switch (state)
   {
    case initialState:
         state = wantClearLEDS;
         break;

    case wantClearLEDS:
         leds[0] [0, 1] = CRGB::Black;
         leds[1] [0, 1] = CRGB::Black;
         leds[2] [0, 1] = CRGB::Black;
         leds[3] [0, 1] = CRGB::Black;
         leds[4] [0, 1] = CRGB::Black;
         FastLED.show();
         state = wantVioletStrip1;
         timeInThisState = 20;
         break;
         
    case wantVioletStrip1:
         FastLED.setBrightness(random(120)+135);
         leds [0][0]= CRGB::Indigo;
         state = wantBlueStrip1;
         break;
         
    case wantBlueStrip1:
         FastLED.setBrightness(random(90)+115);
         leds[0][1]= CRGB::Blue;
         state = wantVioletStrip2;
         break;
         
    case wantVioletStrip2:
         FastLED.setBrightness(random(120)+135);
         leds[1][0]= CRGB::Indigo;
         state = wantBlueStrip2;
         break;
          
    case wantBlueStrip2:
         FastLED.setBrightness(random(90)+115);
         leds[1][1]= CRGB::Blue;
         state = wantVioletStrip3;
         break;
         
    case wantVioletStrip3:
         FastLED.setBrightness(random(120)+135);
         leds[2][0]= CRGB::Indigo;
         state = wantBlueStrip3;
         break;
         
    case wantBlueStrip3:
         FastLED.setBrightness(random(90)+115);
         leds[2][1]= CRGB::Blue;
         state = wantVioletStrip4;
         
    case wantVioletStrip4:
         FastLED.setBrightness(random(120)+135);
         leds[3][0]= CRGB::Indigo;
         state = wantBlueStrip4;
         break;
         
    case wantBlueStrip4:
         FastLED.setBrightness(random(90)+115);
         leds[3][1]= CRGB::Blue;
         state = wantVioletStrip5;
         break;
         
   case wantVioletStrip5:
        FastLED.setBrightness(random(120)+135);
        leds[4][0]= CRGB::Indigo;
        state = wantBlueStrip5;
        break;
        
   case wantBlueStrip5:
        FastLED.setBrightness(random(90)+115);
        leds[4][1]= CRGB::Blue;
        state = wantReset;
        break;
        
   case wantDisplay:
    FastLED.show();
    state = wantReset;
    timeInThisState = (random(200));
    break;

     case wantReset:
         leds[0] [0, 1] = CRGB::Black;
         leds[1] [0, 1] = CRGB::Black;
         leds[2] [0, 1] = CRGB::Black;
         leds[3] [0, 1] = CRGB::Black;
         leds[4] [0, 1] = CRGB::Black;
     FastLED.show();   
        state = wantVioletStrip1;
        timeInThisState = 20;
        break;
        
    }  // end of switch on state
  }  // end of doStateChange


void loop ()
  {
   if (millis () - lastStateChange >= timeInThisState)
     doStateChange ();

  // other stuff here like testing switches
  }  // end of loop

sorry, multi tasking and forgot to post updated code

Missing FastLED.show(); perhaps ?

I have it in the stare "display" which seems to be working as the first pixel in each array loghts up. Unless im missing something?

You need to call FastLED.show() each time that you want a new effect to be displayed. Are you doing that ?

As far as i can see yes, its setting the parameters in the states then when reaching the end it should display said states.

Ill try adding show to each state anyway and report back

What is the point of using a state machine if all you want to do is to set various LEDs on various strips to particular colours then show them all at once ?

Done it this way to set the brightness at random levels on each one

Does the Brightness need a FastLED.show() to take effect ? If so, then it will be the last one before the FastLED.show() that is acted upon

You don't need a state machine to do what you are attempting. What would be good is an array holding the parameters for what you are currently calling a state. Then iterate through the array, pull out the parameters and use them.

By the way, I still think that it would be easier to have all of the LEDs in a single strip

It would be but the wiring is already done and impossible at this stage to add another wire to make it a single strip.

The kther reason for trying to do it this way is its the only way i know how to do, im not at all versed with this stuff

This is the equivalent of one part of your sketch and not a state in sight

            FastLED.setBrightness(random(120) + 135);
            leds[0][0] = CRGB::Indigo;
            FastLED.setBrightness(random(90) + 115);
            leds[0][1] = CRGB::Blue;
            FastLED.setBrightness(random(120) + 135);
            leds[1][0] = CRGB::Indigo;
            FastLED.setBrightness(random(90) + 115);
            leds[1][1] = CRGB::Blue;

Using an array to hold the LED data would be more complicated to get your head round but would make the code much neater and easier to maintain. However, the important thing at the moment for you is to get the code working at all, let alone in the best way

honestly way too complicated for me to wrap my head around without a step by step guide/assistance.

Which part is too complicated ?

The code snippet that I posted above is simply a portion of your code with the state machine removed so that the commands follow one another rather than the state changing so that the code for the next state is executed on the next iteration of the loop() function

Let's put some blank lines in it to break it into where the state used to be

            FastLED.setBrightness(random(120) + 135); 
            leds[0][0] = CRGB::Indigo;

            FastLED.setBrightness(random(90) + 115);
            leds[0][1] = CRGB::Blue;

            FastLED.setBrightness(random(120) + 135);
            leds[1][0] = CRGB::Indigo;

            FastLED.setBrightness(random(90) + 115);
            leds[1][1] = CRGB::Blue;

Each pair of lines is the code from one of your states

i think the confusion is because without the state machines in place, getting the timing to work defaults me back to using "delay" which isnt a bad thing in this code as nothing else is really happening that delay would interfear with

???

Let's go back to basics

Please explain exactly what you want the sketch to do as I have lost track

Since we're back to square one, in addition to Bob's request, please tell us (because we shouldn't have to go find and read some other thread in order to help you):

  1. What Arduino are you using? (memory constraints may become an issue with a 2D array)
  2. How many LEDs in each string? (does it vary? If so, a better argument for a 1D array with indices)
  3. Is the code in post #23, above, your current code, or has it changed more?
  4. I'll refrain from asking for a schematic, etc. No need to go down that rabbit hole, yet.

Oh, and please "unsolve" this thread, as it's apparently revived.

so essentailly, i need it to take 5 arrays with 2 pixels and flicker each pixel, independently at different brightnesses, between 130 (+125) and at random intervals between 100 and 200ms.

one pixel per array in indigo and the other in blue.

the final code will be loaded onto an arduino nano.

the latest post with code is the current itteration of it and no changes have been made since.

also im very sorry for the late reply to the requests, life got really crazy for a couple of days.

think i covered all the questions.

as for schematic, i'll so what i can but if theres a website that has like a drag and drop interface it'll make life easy

dont know if that helps with wiring.

i mislabelled the 5v and gnd, both would be common with the arduino supply.

schematic - old school, but pen, paper, photo does as well as anything, for most entry level schematics we need around here. You can use more sophisticated tools later, when you're 'fully engaged' in the hobby!