ok so as per a suggestion, new thread as things have changed severely since starting last one.
i will post the code below to where i've got it so far but i have one, hopefully, simple question that i cannot find the answer to on google or within the example sketches.
how do i address a single pixel within an array that is suitable for the code setup and structure below?
to address some key points, the reason for multiple arrays on multiple pins with only 2 pixels per array/pin is because the project this is being installed into is a model of a pokemon called chandalure. it has 2 main arms, from which 2 smaller arms protrude. the 2 main arms come from the sides of its "head", a pumpkin shape. the model has already been wired up, assembled and painted with only 3 wires in each of the 4 smaller arms running down the 2 larger arms and into the head. 5v, gnd and signal there isnt enough room within the arms for 4 wires per smaller arm. hopefully that makes sense.
the code isnt the cleanest or most efficient but i can clearly see whats going on and make any changes to it at any stage without overloading my mind as my knowledge is limited and this is the simplest path for my knowledge level. i appreciate there are better ways to do this but i'd like to stick to what i've already got going on. I just need to learn how to address single pixels within an array and im hoping this will teach me that with your assistance.
heres the code:
//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] = CRGB::Black;
leds[1] = CRGB::Black;
leds[2] = CRGB::Black;
leds[3] = CRGB::Black;
leds[4] = CRGB::Black;
FastLED.show();
timeInThisState = 20;
break;
case wantVioletStrip1:
FastLED.setBrightness(random(120)+135);
leds [0][0], CRGB::Indigo;
state = wantBlueStrip1;
break;
case wantBlueStrip1:
FastLED.setBrightness(random(120)+135);
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(120)+135);
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(120)+135);
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(120)+135);
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(120)+135);
leds[4][1], CRGB::Blue;
state = wantReset;
break;
case wantDisplay:
FastLED.show();
state = wantReset;
timeInThisState = (random(200));
break;
case wantReset:
leds[0] = CRGB::Black;
leds[1] = CRGB::Black;
leds[2] = CRGB::Black;
leds[3] = CRGB::Black;
leds[4] = 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