Sorry couldn't figure out how to post in an existing discussion.

So you laid everything out pretty straightforward for me, but I can’t seem to find where the enum ModeType_t goes?

http://pasted.co/4d56997d

and once all of that is said and done how would I go about setting individual counters?

lol sorry for being so inept, this is starting to get wayyy over my head. I am still struggling to understand what you have so kindly laid out for me.

An enumerated type is much more readable than hard coded numbers and makes it much easier to add new modes and/or reorder the modes. The only thing is to make sure that MAXIMUM_MODES is the last one in the list.
For the Random mode counts look at:
#define COUNTS_DEFAULT 1000
const uint16_t myCounts[] = { MODE_PALETTE, 1500, MODE_EKG, 2000 };
The default should be obvious and assigning the myCounts array this way should mean that even when changing the mode order it will still work. You only have to add a Mode & Count to the array when they need to be different from the default.
Now to add new modes you will just have to add another MODE_ name to the enum along with an Init case and a Loop case. The maximum number of modes will automatically increase.
Hope this makes sense :slight_smile:

Ya for sure, this is far more convenient as well. Thank you very much. Now the arduous task of separating the palette animation, and programming more sprite animations.

@Aaron_Liddiment
Sort of and off topic question, still pertaining to the button press i suppose. A friend of mine is making bracelets with the WS2812B and wanted to use the neopixel strandtest example and have a button to switch between. Now I thought I could achieve this easily since you have given me all of the basics to do so, the problem is that it is acting quite funny, it only switches sometimes, and usually only towards the end of that specific animation?? any thoughts

http://pasted.co/5a6fc1bf

You should remove the first debouncer bits:
debouncer.update();
if (debouncer.read() == LOW)
{
and also the trailing } after the complete switch case.
You only need the debouncer.update and fell check to select incrementing myMode.

still seems to want to not switch… not entirely sure why, could it be the way the neopixel example is written?

http://pasted.co/c292e508

http://pasted.co/982ef38e
You took out all the curly braces including the ones around the if fell check!

Also though, I have just noticed that some of the routines hold onto execution and do multiple loops before they return. So changing functions could take some time before the switch press is actioned.

This may have been your problem all along as missing the curly braces would have meant the myMode+; was done with the if anyway. It didn’t really matter about the myMode check as this only had an effect if the fell condition happened.

Basically the demo functions are not loop friendly, it will require some work to make them cope with being re-entrant.

Still responds weird. Oh well I think it could just be the weird adafruit code that is doing something to it. Doesn’t seem to want to switch till the end of the animation and even then you have to get the timing right… I think, lol. anyway thanks for trying.

Did you read my above comments?
The demo functions are not loop friendly, they need to be made re-entrant and some statics. I may get some time in the morning to work on it for you.

http://pasted.co/1de252e9
Try this :wink:

wow, works perfect, Thank you. I will have to examine this a little more closely to see if I can figure out what you did.

Oh hey, sorry. I was not ignoring your previous comments but they did not show up on my phone for some reason?? Anyway it was not that big of a deal to get it working :slight_smile: so thank you very much once again.

Still soldering my brothers 8x39 matrix, so I will have an update on how things work on it in a few days, going to a music festival tomorrow for a couple of days :slight_smile:

Have a good time :slight_smile:

@Aaron_Liddiment
So I may have screwed up a little, I epoxied my side shields on to my matrix… upside down. I managed to assign the proper starting led and I got the scrolling text to scroll right to left, but the characters are reverse. Is there a mirror char option?

I got it, I put a - in front of both the matrix width and matrix height and put a scroll left effect on the text, everything works fine now :slight_smile:

Well done :slight_smile:
You could also have changed the character direction but you wold have had to reverse the vertical axis.

@Aaron_Liddiment
I am having a bit of difficulty with your sprite program again, I made a side shield of led’s for my brothers helmet, and i wanted to do some animations on it. it is 3 wide by 8 tall in a vertical zigzag. I have tried messing about with the different variables but cant seem to get it to do anything that resembles what i am looking for. should it be layed out like so?

B8_1BIT(101),
B8_1BIT(010),
B8_1BIT(101),
B8_1BIT(010),
B8_1BIT(101),
B8_1BIT(010),

And i suppose the same question would apply for the 8x36 matrix I had made for him, it is 36 tall by 8 wide would the sprite pattern be laid out in a similar fashion
E.G.

B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00111100),
B8_3BIT(01111110),
B8_3BIT(11111111),
B8_3BIT(11211211),
B8_3BIT(12322321),
B8_3BIT(12322321),
B8_3BIT(11211211),
B8_3BIT(11111111),
B8_3BIT(11111111),
B8_3BIT(11111111),
B8_3BIT(11111111),
B8_3BIT(11111111),
B8_3BIT(12111121),
B8_3BIT(11222211),
B8_3BIT(11111111),
B8_3BIT(11111111),
B8_3BIT(01111110),
B8_3BIT(00111100),
B8_3BIT(00000000),
B8_3BIT(00000000),
B8_3BIT(00000000),

???