Pages: [1]   Go Down
Author Topic: 1 Arduino with 6 Neo_Pixel60  (Read 341 times)
0 Members and 1 Guest are viewing this topic.
California, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After looking at many sample codes and other people project codes, i was able to somehow hack together codes to make my own show. (A simple firework looking show)
Now I'm stump. smiley-sad

But before i get ahead, this is the hardware I'm using:
1x Arduino Uno r3 and
6x 5 meters of Neo_Pixel 60 Digital RGB LED Strips
1x 450W Computer Power Supply

What I'm stuck at is that i want to run (if it's even possible) the same show using 1 Arduino Uno with 6 outputs (one output at a time), each output will be connected with a 5 meter LED strip.

If it's not possible, then maybe daisy-chain 6 Arduinos, each running the same show and 1 strip of LEDs attached to it.
When one arduino runs the show and finish then, somehow, it activates the next arduino and so on then loop back to the first arduino.
Is this even possible?
If it is, how would the coding be.

I'm new to coding (total Noob) and to arduino.
I just copy/paste different codes together, change different values until i got a show working. (I have no idea what each command mean, that's how new I am to coding)

If you or anybody else have a better solution to this, I'm all ears and welcome to all the help I can get.

Please help me to the right path.
Thanks for reading post.

Code:

    #include "FastSPI_LED2.h"

    #define NUM_LEDS 255 //Total LEDs of strand
    #define DATA_PIN 6  // Data pin that led data will be written out over

    CRGB leds[NUM_LEDS];


    int thisdelay = 1;          //-FX LOOPS DELAY VAR
    int thissat = 255;           //-FX LOOPS DELAY VAR
    int idex = 0;                //-LED INDEX (0 to LED_COUNT-1
    int ihue = 0;                //-HUE (0-255)



    void setup() {
     
            // sanity check delay - allows reprogramming if accidently blowing power w/leds
          delay(2000);
       
            FastLED.addLeds<WS2811, DATA_PIN, GRB>(leds, NUM_LEDS);
            one_color_all(0,0,0); //-CLEAR STRIP
            FastLED.show();
    }

    void loop() {
       for(int i = 0; i < 6; i++) {
          for(int iLed = 0; iLed < 60; iLed++) {
             memset(leds, 0,  NUM_LEDS * sizeof(struct CRGB));

             switch(i) {
                // You can access the rgb values by setting the rgb values for the pixel all at once
                 case 0: leds[iLed] = CRGB(255, 50, 0); break;
                                    case 1: one_color_all_1(255,0,0); break;  //-SET FIRST RING TO ONE COLOR
                                    case 2: one_color_all_2(0,255,0); break;  //-SET SECOND RING TO ONE COLOR
                                    case 3: one_color_all_3(0,0,255); break;  //-SET THIRD RING TO ONE COLOR
                                    case 4: random_color_pop4(); break;       //ALL RINGS-RANDOM COLOR POP
                                    case 5: one_color_all(0,0,0); break; //-CLEAR STRIP

             }

             // and now, show your led array!
             FastLED.show();
             delay(1);
          }


               delay(1);

       }
    delay(2000);
    }


    void random_color_pop4() {                         //ALL RINGS-RANDOM COLOR POP
      idex = random(60, 255);
      ihue = random(0, 200);
      one_color_all(0, 0, 0);
      leds[idex] = CHSV(ihue, thissat, 255);
      FastLED.show();
      delay(1);
    }

    void one_color_all(int cred, int cgrn, int cblu) {       //-SET ALL LEDS TO ONE COLOR
        for(int i = 0 ; i < NUM_LEDS; i++ ) {
          leds[i].setRGB( cred, cgrn, cblu);
        }
    }

    void one_color_all_1(int cred, int cgrn, int cblu) {       //-SET FIRST RING TO ONE COLOR
        for(int i = 60 ; i < 75; i++ ) {
          leds[i].setRGB( cred, cgrn, cblu);
        }
    }

    void one_color_all_2(int cred, int cgrn, int cblu) {       //-SET SECOND RING TO ONE COLOR
        for(int i = 75 ; i < 135; i++ ) {
          leds[i].setRGB( cred, cgrn, cblu);
        }
    }

    void one_color_all_3(int cred, int cgrn, int cblu) {       //-SET THIRD RING TO ONE COLOR
        for(int i = 135 ; i < 255; i++ ) {
          leds[i].setRGB( cred, cgrn, cblu);   
        }
    }
Logged

SF Bay Area
Offline Offline
Edison Member
*
Karma: 11
Posts: 1244
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd recommend using a Teensy 3.0 instead. The OctoWS2811 library will drive 8 strips at the same time.
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Pages: [1]   Go Up
Jump to: