I want one strip to continuously phase / cycle through all the colors while another strip switches colors depending on what button is pressed.
I've been trying a few ways with millis and fastlibrary but I'm just not sure how to do it. I'd like if I could use two seperate pins but I could also just solder the two strips together. Any help would be appreciated ;_;
LarryD
March 15, 2022, 5:00pm
2
Show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.
In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch .
Use the </> icon from the ‘reply menu’ to attach the copied sketch.
Use 2 separate pins and treat them as separate strips. That is the best that I can say with the little information that you have given.
What Arduino board?
What strips do you have?
What library are you using to control them?
Here is an example using the FastLED library to control 2 separate WS2812 strips.
#include <FastLED.h>
// 2 data pins
const byte DATA_PIN_1 = 6;
const byte DATA_PIN_2 = 5;
const byte NUM_LEDS_1 = 10;
const byte NUM_LEDS_2 = 20;
// 2 data arrays
CRGB leds_1[NUM_LEDS_1];
CRGB leds_2[NUM_LEDS_2];
void setup()
{
Serial.begin(115200);
LEDS.addLeds<WS2812, DATA_PIN_1, GRB>(leds_1, NUM_LEDS_1);
LEDS.addLeds<WS2812, DATA_PIN_2, GRB>(leds_2, NUM_LEDS_2);
}
void loop()
{
for(int n = 0; n < NUM_LEDS_1; n++)
{
leds_1[n] = CRGB::Red;
}
for(int n = 0; n < NUM_LEDS_2; n++)
{
leds_2[n] = CRGB::Blue;
}
FastLED.show();
}
1 Like
Thank you, groundFungus. That's what I was looking for.
system
Closed
September 11, 2022, 5:54pm
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.