Running three RGB LED strips simultaneously

We are trying to make an arduino run three different patterns on three different Led strips. We are using this circuit, Usage | RGB LED Strips | Adafruit Learning System, to control the leds. The program we are using is very similar to the page after that just repeated three times.

For whatever reason it runs one fade then the next then the next and repeat. How might we get all three fades to run continuously. They run fine on their own but they won't run together.

We have time to make any changes and are new so we are up for learning. If you have any idea please let us know.

Thank You

For whatever reason it runs one fade then the next then the next and repeat.

That is because it is exactly what the code you have written does.

How might we get all three fades to run continuously. They run fine on their own but they won't run together.

You write the code as a state machine, examples are:-
My
http://www.thebox.myzen.co.uk/Tutorial/State_Machine.html
Or Robin2's several things at once

Grumpy_Mike beat me to it!

To re-iterate… (and dumb it down a bit perhaps)

I havent looked at the specific code… but (most likely)… the ‘animation’ is stuck in some sort of animation ‘loop’…

And wont exit that loop until that specific animation is complete and some sort of flag/threshold/parameter is met.

Then on to the next animation ‘loop’

As Grumpy_Mike alluded to…

What you need to do is:

Increment that specific animation/loop 1 step.

Move on to the next animation ‘loop/function’ and increment that by 1 step…

etc…etc…

it seems ‘slow’… but the code will run/execute so fast… you wont notice any real difference.

You can only run two different Led strips with Arduino UNO like this

// color swirl! connect an RGB LED to the PWM pins as indicated
// in the #defines
// public domain, enjoy!
// for Arduino you can use analogWrite() on pins 3, 5, 6, 9, 10 or 11 (for classic Arduinos using the Atmega328 or 168).
 
#define REDPIN 5 // First set RGB Led strips
#define GREENPIN 6
#define BLUEPIN 3

#define REDPIN2 9 // Second set RGB Led strips
#define GREENPIN2 10
#define BLUEPIN2 11


#define FADESPEED 5     // make this higher to slow down
 
void setup() {
  pinMode(REDPIN, OUTPUT);
  pinMode(GREENPIN, OUTPUT);
  pinMode(BLUEPIN, OUTPUT);
  pinMode(REDPIN2, OUTPUT);
  pinMode(GREENPIN2, OUTPUT);
  pinMode(BLUEPIN2, OUTPUT);
}
 
 
void loop() {
  int r, g, b;
 
  // fade from blue to violet
  for (r = 0; r < 256; r++) { 
    analogWrite(REDPIN, r);
    analogWrite(REDPIN2, r);
    delay(FADESPEED);
  } 
  // fade from violet to red
  for (b = 255; b > 0; b--) { 
    analogWrite(BLUEPIN, b);
    analogWrite(BLUEPIN2, b);
    delay(FADESPEED);
  } 
  // fade from red to yellow
  for (g = 0; g < 256; g++) { 
    analogWrite(GREENPIN, g);
    analogWrite(GREENPIN2, g);
    delay(FADESPEED);
  } 
  // fade from yellow to green
  for (r = 255; r > 0; r--) { 
    analogWrite(REDPIN, r);
    analogWrite(REDPIN2, r);
    delay(FADESPEED);
  } 
  // fade from green to teal
  for (b = 0; b < 256; b++) { 
    analogWrite(BLUEPIN, b);
    analogWrite(BLUEPIN2, b);
    delay(FADESPEED);
  } 
  // fade from teal to blue
  for (g = 255; g > 0; g--) { 
    analogWrite(GREENPIN, g);
    analogWrite(GREENPIN2, g);
    delay(FADESPEED);
  } 
}

You can run 3 strips, or really as many as you'd like within reason, by treating it as one long strip and some creative coding.

The method also depends on exactly what kind of strip you have.

INTP:
You can run 3 strips, or really as many as you'd like within reason, by treating it as one long strip and some creative coding.

The method also depends on exactly what kind of strip you have.

Using hardware PWM of the processor? If so, you make me curious.

Hi,
Welcome to the forum.

The Adafruit site does not show how to properly connect the strip to a supply voltage.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html

Thanks.. Tom.. :slight_smile: