HerrRausB GammaHoopAnimator help

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
xiaoli
 
Posts: 3
Joined: Tue Feb 25, 2014 3:10 pm

HerrRausB GammaHoopAnimator help

Post by xiaoli »

Hi everyone,

I'm trying to run 2 12led neopixel rings with this code.
https://github.com/HerrRausB/GemmaHoopA ... imator.ino

The code is for running a 16led ring but I'm trying to use it for my setup. When I change the number of pixels to 24 and load it into my trinket, it bugs out and won't run. Anything above 16 will not run. What am I not seeing in the code that would cause it only to be able to run 16 leds at a time? The code is running 12+4 leds from the second ring at the moment so it's not hardware related.

Thanks in advance!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: HerrRausB GammaHoopAnimator help

Post by adafruit_support_mike »

All the loops are controlled with reference to the NUM_PIXELS macro, defined in GemmaHoopActionList.h . Change that definition and everything should play nicely.

xiaoli
 
Posts: 3
Joined: Tue Feb 25, 2014 3:10 pm

Re: HerrRausB GammaHoopAnimator help

Post by xiaoli »

That's exactly what I did when I reviewed the code. When I upload it into the trinket, it doesn't work. The red light on pin 1 just lights up intermittently but the neopixels stay black. I can't seem to see what would cause it not to work if I changed the NUM_PIXELS definition to 24.

xiaoli
 
Posts: 3
Joined: Tue Feb 25, 2014 3:10 pm

Re: HerrRausB GammaHoopAnimator help

Post by xiaoli »

adafruit_support_mike wrote:All the loops are controlled with reference to the NUM_PIXELS macro, defined in GemmaHoopActionList.h . Change that definition and everything should play nicely.
I figured out the problem. I'm guess there's too many "actions" in the action_list and the trinket didn't have enough room to buffer more than 16 leds. Once I reduced the list of actions, it started to work.

Thanks again for your help!

HerrRausB
 
Posts: 7
Joined: Sun Aug 19, 2012 2:01 am

Re: HerrRausB GammaHoopAnimator help

Post by HerrRausB »

Seems as if I got world famous with that little piece of code ;-) The assumption is right - as I mentioned in the header file, the number of actions is limited by the µC's RAM. It might be a good idea to rework the code and use the flash memory for the actions - with the 8K of the attiny on the trinket, that really would increase the opportuinities - could make an evening filling super duper light show ;-) At the moment I have other projects going on, so I wont be able to change the code, but using the flash memory ain't that complicated - descriptions can be found all over the place, just found that one:

http://www.nongnu.org/avr-libc/user-man ... space.html

Briefly spoken: Modify the action list to be in PROGMEM using the respective mechanisms and then read out the next action lines using the pgm_read_byte() macro into a suitable buffer. From there on, you cn use the code as is I guess. Don't forget to include <avr/pgmspace.h>!

Regards

Axel

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”