0

NeoPixel, Arduino, 4 Strips, 3 light.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NeoPixel, Arduino, 4 Strips, 3 light.

by AdaptiveDroids on Wed Feb 06, 2019 12:30 am

Sorry if this is in the wrong forum. I cannot find the neopixel.h forum.

I have 4 144 led WS2812b strips on data 2,3,4,5 Using a Nano and 1.8.8 IDE.

any combination of 3 pins works but cannot address 4 strips.

Program compiles OK.

AdaptiveDroids
 
Posts: 6
Joined: Wed Feb 06, 2019 12:21 am

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by adafruit_support_carter on Fri Feb 08, 2019 6:45 pm

Post the complete code you are using.

adafruit_support_carter
 
Posts: 10966
Joined: Tue Nov 29, 2016 2:45 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by AdaptiveDroids on Sat Feb 09, 2019 12:26 pm

Here is a sample.
I am using 1.6.21 and have tried 1.6.23
Code: Select all | TOGGLE FULL SIZE
int force;

// 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_a = Adafruit_NeoPixel(NUM_LEDS, 5, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_b = Adafruit_NeoPixel(NUM_LEDS, 4, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_c = Adafruit_NeoPixel(NUM_LEDS, 3, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_d = Adafruit_NeoPixel(NUM_LEDS, 2, NEO_GRB + NEO_KHZ800);

void setup() {
  strip_a.begin();
  strip_b.begin();
  strip_c.begin();
  strip_d.begin();
  strip_a.show(); // Initialize all pixels to 'off'
  strip_b.show(); // Initialize all pixels to 'off'
  strip_c.show(); // Initialize all pixels to 'off'
  strip_d.show(); // Initialize all pixels to 'off'
  Serial.begin(115200);
}
void loop() {
 
  wrathofmom();
  //foot_fire();
}
 
void wrathofmom(){   

        force = analogRead(3);

        if (force <700){
       
       
        for (int led = NUM_LEDS; led > 0; led--) {
        strip_a.setPixelColor(led+1, 0, 0, 0);
        strip_b.setPixelColor(led+1, 0, 0, 0);
        strip_c.setPixelColor(led+1, 0, 0, 0);
        strip_d.setPixelColor(led+1, 0, 0, 0);
            strip_a.setPixelColor(led, 255, 255, 255);
            strip_b.setPixelColor(led, 255, 255, 255);
            strip_c.setPixelColor(led, 255, 255, 255);
            strip_d.setPixelColor(led, 255, 255, 255);
            strip_a.show();
            strip_b.show();
            strip_c.show();
            strip_d.show();
        }
           
                   
}
wrathofmom();

}
Last edited by adafruit_support_carter on Sun Feb 10, 2019 1:42 pm, edited 1 time in total.
Reason: added [code] tags

AdaptiveDroids
 
Posts: 6
Joined: Wed Feb 06, 2019 12:21 am

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by kcl1s on Sat Feb 09, 2019 11:19 pm

The neopixel library takes time to send the data. It may work better if you put a short delay in your function.

Just a note on the code you posted. You set your pixel values to off then to full white but the 'off' never gets sent to the physical string with a 'show()'

Fellow hobbyist
Keith

kcl1s
 
Posts: 1154
Joined: Tue Aug 30, 2016 12:06 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by AdaptiveDroids on Sun Feb 10, 2019 1:02 am

Strange that is not the working code. ( or not the code I meant to send.)

I will send the corrected code tomorrow. But basically it writes 0,0,0 to all leds, displays , writes 255,255,255 to all leds, displays.
as fast as it can. This causes a single led to meander down the strip at about 1.5 seconds end to end.

AdaptiveDroids
 
Posts: 6
Joined: Wed Feb 06, 2019 12:21 am

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by kcl1s on Sun Feb 10, 2019 9:01 am

OK. Not sure how you get that effect by turning all pixels on and off. I would think changing the values of the 2 pixels you want changed (1 on, 1 off) with a 10 ms delay (10 ms x 144 pixels = 1.44 seconds) would be a much more efficient way to do it with predictable results. This will also allow all 4 strips to work.

Keith

kcl1s
 
Posts: 1154
Joined: Tue Aug 30, 2016 12:06 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by adafruit_support_carter on Sun Feb 10, 2019 1:51 pm

As a way to test that all 4 strips works, try a simple code that just sets them to a value and make sure they all come on:
Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>

#define NUL_LEDS 144

Adafruit_NeoPixel strip_a = Adafruit_NeoPixel(NUM_LEDS, 5, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_b = Adafruit_NeoPixel(NUM_LEDS, 4, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_c = Adafruit_NeoPixel(NUM_LEDS, 3, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_d = Adafruit_NeoPixel(NUM_LEDS, 2, NEO_GRB + NEO_KHZ800);

void setup() {
  strip_a.begin();
  strip_b.begin();
  strip_c.begin();
  strip_d.begin();
  strip_a.fill(0x200000);
  strip_b.fill(0x002000);
  strip_c.fill(0x000020);
  strip_d.fill(0x200020);
  strip_a.show();
  strip_b.show();
  strip_c.show();
  strip_d.show();
}

void loop() {
  // do nothing
}

adafruit_support_carter
 
Posts: 10966
Joined: Tue Nov 29, 2016 2:45 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by AdaptiveDroids on Sun Feb 10, 2019 11:49 pm

Sorry All, I am confusing two DIFFERENT forum posts. this one is in regard to only lighting 3 of 4 strips.

using the test you provided is effectively the same as my test. I simply light any leds on all for strips.

The result is 3 of the four light.

Let me be clear. If I say light 5,4,3,2 - 5,4,3 light 2 does not.
If I say light 5,4,3 - 5,4,3 light
If I say light. 4,3,2 - 4,3,2 light
If i say light 2,5,4 - 2,5,4 light.

There is solution posted fro the FAST LED library to use anolder build. as I stated in my opening post. I have tried 21 and 23 with this library to no avail.

BTY Where did you get the strip_b.fill() from? Maybe I am missing out on commands for this library?

AdaptiveDroids
 
Posts: 6
Joined: Wed Feb 06, 2019 12:21 am

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by kcl1s on Mon Feb 11, 2019 12:37 am

Just realized you are probably running out of ram on a Nano with close to 600 pixels. To confirm set each strip to 50 pixels and see if it works.

Keith

kcl1s
 
Posts: 1154
Joined: Tue Aug 30, 2016 12:06 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by adafruit_support_carter on Mon Feb 11, 2019 1:06 pm

Try what @kcl1s suggests above That's a good idea.

adafruit_support_carter
 
Posts: 10966
Joined: Tue Nov 29, 2016 2:45 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by AdaptiveDroids on Tue Feb 12, 2019 7:52 pm

Thanks for the replies. Nope same issue. 50, LEDS, 10 Leds, 20 LED, per strip.

AdaptiveDroids
 
Posts: 6
Joined: Wed Feb 06, 2019 12:21 am

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by kcl1s on Wed Feb 13, 2019 6:56 am

Post the exact code with 50 pixels declared that you are having trouble with. We can throw out suggestions but looking at the code that does not work is the best way.

Keith

kcl1s
 
Posts: 1154
Joined: Tue Aug 30, 2016 12:06 pm

Re: NeoPixel, Arduino, 4 Strips, 3 light.

by AdaptiveDroids on Wed Feb 13, 2019 10:18 am

Lost my nano. I mistakenly was programming it USB but forgot to connect my battery supply to the led array. So I pulled all of the LED current through the arduino board.

I am waiting for a pair of MAX40200 Idealdiodes, a new nano and a voltage regulator for the failed board. Most should be here today.

Got to LOVE AMAZON PRIME same day.

AdaptiveDroids
 
Posts: 6
Joined: Wed Feb 06, 2019 12:21 am

Please be positive and constructive with your questions and comments.