2 Replies Latest reply on Jun 20, 2017 8:18 AM by mcb1

    144 neopixels

    duitsman

      Hi there,

       

      I have a question for a product I am making for school. I have 144 neopixels joint together and want to make a photoshop animations. This PS animation has to work on the neopixel. For setting the color of each neopixel i use one line of code. setPixelcolor ( 0,233,20,84) like this but this is a lot of work when i have to set each pixel to one color for every picture i have. Does anyone know her how to set different pixels to one color the fast way. So lets say that i want 32 different pixel the color green. For example pixel 0, 2,5,8,19,34,50, 51,55 etc.

       

      I know i can do this line by line but thats a lot of work with 144 pixel animations. 

       

      Can i do this with a variable ? and if so can anyone help me with the program?

       

      Greetings

        • Re: 144 neopixels
          rpbruiser

          You could perhaps make an array with all the values of the pixels you want colored a certain way, and using a loop go through the array and color each pixel accordingly. I'll give an example below.

          int greenPixels[] = {0,2,5,8,19,34,50,51,55};
          
          for(i = 0; i < sizeof(greenPixels); i++) {
              pixel = greenPixels[i];
              setPixelcolor(pixel,233,20,84);
          }
          
          1 of 1 people found this helpful
          • Re: 144 neopixels
            mcb1

            Have you looked at this guide.

            https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library

             

            There are some good examples within the library that will have been loaded when you installed it.

             

             

             

            Basically you need to set each Neopixel with a colour, but you can address each one and they retain that setting.

             

            eg, If the first 32 are green and you want to change the 11th and 12th one you can simply change them and not bother with any others.

             

            It is quite cumbersome and you will need to store the setting for each of the 144 neopixels at each step of the animation.

            Note the caution at the bottom regarding memory consumption.

             

             

            Mark

            1 of 1 people found this helpful