Hello everybody. I"m new to Arduino, and the first project I would like to make is a chandelier out of bongo drums. I’m using a 2811 with 300 LEDs that are controllable in groups of 3. My goal is to have each drum (6 bongos, and 1 individual drum, for a total of 13 sections), individually adjustable using a wireless controller (but that’s another group at another time). My question right now is, can my code be condensed so i’m not using as much memory? I want to have a number of preset holidays, in addition to solid colors and possibly a rainbow and/or party mode, but i’m afraid i’m going to run out of room. this is a small sample of where i’m going so far, and any help is appreciated (when it starts up, it just starts up white, and i have it set to low brightness because it’s sitting right next to me and i don’t need to go blind
) TIA
@Chris_Liska Hello Chris.
Please use http://gist.github.com to share code. It makes it much easier to read, and line numbers can be referenced for discussion.
Here’s an example of lighting up blocks of pixels that would simplify your code some.
And another example to give you more ideas.
Btw, what controller are you using? When you upload your code from the Arduino IDE it reports how much memory is being used.
I’ll be using a mini pro board, and i’ve seen where it says how much memory is used, but i plan on having about 50 preset color choices along with some other libraries for LCD, wireless communication, and a menu/submenu system in addition to the fastLED library. what i posted seems like it should be able to be consolidated somehow, i just didn’t know how. if it can’t then i’ll work with it as is and get as many presets as possible.
Consider making a subroutine that you pass a color to (and a brightness too if you want specific brightnesses for certain colors). Also you could remove the http://FastLED.show() from each of those individual sections and just have it once at the bottom of the main loop.
I’m rather looking forward to seeing this project. Sounds really fun!