I’m after some advice for my project… Details of my setup –
I have 12 concentric rings of the individual NeoPixel PCB’s each soldered into their own data pin to my Arduino UNO
The first ring has 84 NeoPixels and each subsequent ring has 6 less than the previous (84, 78, 72, 66 and so on)
I believe I need them as separate rings to achieve the “animation” that I’m after.
My problem is that when I try to declare each of my rings and number of LED’s in each ring in my code I very quickly run out of memory for Global Variables.
And yet when I run one of the FastLED>multiple example sketches and just say they all have the largest number of LEDs in them it will run, this won’t work as I need the animation to run at different speeds in each ring so that the smallest ring finishes at the same time as the largest ring.
I am very new to Arduino and have jumped in at the deep end with this one, any help would be greatly appreciated
@James_Churches - An Arduino Uno is a good starting place for small projects, i.e. a small number of NeoPixels. For a large project like yours, I would recommend that you use the Teensy 3.2. It has much more memory than a Uno. It is faster and more powerful than an Uno. It costs less than an Uno. The Teensy 3.2 is similar to program as the Uno but you need to use Teensyduino IDE along with the Arduino IDE.
The Uno has 2 KB RAM. Each LED requires at least 3 bytes. If you have 612 LEDs (84+78+72…+24+18), that’s 1,836 bytes, which doesn’t leave much for anything else.
I agree with @Ken_White , you need a better microcontroller. I highly recommend the Teensy 3.2, which is capable of driving many more LEDs at higher framerates than an Uno. The only disadvantage is it uses 3.3v logic (as do most MCUs) and might require a level shifter to drive your LEDs which require 5v logic. I recommend the OctoWS2811 for the Teensy: https://www.pjrc.com/store/octo28_adaptor.html It provides 8 level shifted outputs, so you might need to connect a few of your rings together. Once you get it working, we can discuss how to handle breaking those connected rings up in code, which is relatively easy.
I already have an Arduino Mega to play with as well, the same code is also too large for that, but would there be a way of getting that reduced down?
if i had the Neopixels all running off one data line could i create a round matrix and still achieve the kind of animation i’m after - if you look at this video… I want to create a light effect similar to what you see on the wheels of this car - https://www.youtube.com/watch?v=QkQhm48cAYk
Megas should have 8KB RAM, which should be enough, depending on what you’re doing. Post a link to your code on GitHub, Gist, Pastebin, etc if you’d like advice on reducing memory usage.
I’ve not used it before, but this should be a link to my code on pastebin.
At the moment I haven’t written any of my own code - I have just tried to modify examples to get them to work with my 12 ring set-up
Looks like you’re creating an array for 12 x 641 (7,692) LEDs which will require at least 23,076 bytes RAM. You’d be better off using the max number of LEDs for each: CRGB leds[NUM_STRIPS][84], or just using separate correctly sized arrays (instead of a two dimentional, or array of arrays). This page has options on using multiple strips: https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples
Would there be anyone willing to write the code for us, I wanted to do it my self, unfortunately we are rapidly running out of time on the project - we would pay for the help given.
Please get in touch if that sounds of interest.
I think you were closer before, where you had defined the number of LEDs in each ring. You just needed to change the led array definition.
Try something like this: https://pastebin.com/XH062sks
I really appreciate you taking the time to modify that for me, your code is kind of working, however I’m getting a lot of interference and flickering, I unplugged the inner five rings and the outside ones behaved much better.
so I’m thinking of splitting the rings between my UNO and Mega boards.
I’ll let you know how that goes.
James
@James_Churches
Jumping in here- I don’t know if it’ll help as you’ve already got your ring developed but I created something a few years ago utilizing a disk from ada fruit:
Each ‘ring’ wasn’t inherently defined, but a couple of the animations look close what your trying to replicate. The disks were ran on a 5v trinket pro. If you’re interested I’ll post the mangled code for you to look through- maybe it’ll get you through your time crunch. Sorry I can’t be more help on your current coding issues.
-Tom