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

Yes, that was what I expected!
EFFECT_COLR_EMPTY EFFECT_BACKGND_ERASE
Did you notice these two defines in the TxtDemo line? The first is saying don’t change the pixel where there is a 1 in for font and the second is saying blank out the background where there is a 0 in the font.
If you remove the EFFECT_COLR_EMPTY and change the other to EFFECT_BACKGND_LEAVE, you will get default color text overlaid on the background animation.
If you want to have the animation running for a bit and then have the text running for a bit you will need to have a static mode variable in the loop function and then based on its value either do animation or text. Then say every 1500 loops change the value:

void loop()
{
static uint16_t myCount = 0;
static uint8_t myMode = 0;
if (myMode == 0)
{
Animate
}
else
{
Text
}
myCount++;
if (myCount >= 1500)
{
myMode++;
if (myMode >= 2)
myMode = 0;
}
}

Wow, thank you very much, this is all very awesome. I will try that out right away. I had however planned on trying to implement a button press to change animations, will this still be possible with the loop? I don’t see why it wouldn’t, just thought I would ask :slight_smile:

So if i have this correct do i put the animations in the portion that says “Animate” and what do i put int the “Text” portion. I tried to put it in with the code but i don’t seem to be getting anything. Let me know what you think :slight_smile:

http://pastebin.com/Teq9W940

Here you go http://pastebin.com/PtH40NpV
If you want it to change on a button press then you would just detect the press and change the myMode variable in the later portion of the loop() function instead of incrementing and checking for a maximum count value.

Just noticed you had the matrix type set as VERTICAL_ZIGZAG! I thought you had it wired as a horizontal zigzag starting in the bottom right! If this is the case you will need to change the pastebin code to HORIZONTAL_ZIGZAG.

Ok I see how you added that. This is all great stuff, I am trying to soak up all that i can, I hope that some of it is sinking in :slight_smile: If you don’t mind me asking another question, how would i go about adding your plasma effect to have both as an animation and to show through into the plasma text? if it is too much don’t worry about it. You have already helped me out tremendously .

Oh and apparently even though it is in fact a horizontal matrix, the font does not display correctly unless I change it to vertical?? Beats me, but it works :slight_smile:

Still haven’t figured out the button press, I have managed to figure out a good timing to be able to display the scrolling text and still allow all of the animation to be displayed eventually. However a button press to change to the scrolling text and then maybe to your sprite program would be the best case scenario. I could make do with what you have given me so far if I need to :slight_smile:

Have to pack for work. Trying to bring all the supplies I need to do testing out at camp, I also need to be soldering my brothers matrix for his helmet. They are both coming along quite nicely, just have to do some tidying up of controllers and mount the battery supply.

And if I didn’t mention it earlier, thank you so much for your help. If no one has ever told you, you are an awesome person :slight_smile: and you wrote some amazingly awesome code that looks quite beautiful.

Sorry, went to bed last night as it was late :slight_smile:
Here is one with Plasma, it requires a switch to change mode. Basically one side of the switch goes to the digital pin and the other goes to ground. It is not debounced, so holding it down will rapidly switch modes.
http://pastebin.com/F2HS4rr4
I can add sprites, but memory use will increase quite a bit and I’m not sure what you want to do!
The Matrix Type option refers to the physical wiring, so if you are using vertical then they must be connected up & down.

Awesome!! I won’t have a chance to test this out until tonight. I fly out to work today. We must be in quite different time zones, it is 4:16 AM here currently :slight_smile: have to be up quite early to drive to my flight location.

I think that when I complied I was sitting at about 14k out of 23k? Somewhere along those lines, probably a little too much for my nano. I was just looking to add a set of eyes periodically blinking, heart beating, Cylon eye scanning back and forth, and maybe an EKG pulse. Would the addition of your sprite program add too much even for an uno or a mega? I believe I have the room to accommodate either inside the helmet, I was just trying to keep the footprint small. What kind of memory does a teensy have? Would that be a better route to go? Are the sprite animations similar to bit banging, sorry if I am using that term incorrectly I just mean in terms of
(00011000) and so on?

I just tried adding a 10x11 3 colour sprite with 3 frames and the code only increased by 2.5k and less than 0.1k ram. So you still have space :slight_smile: The sprites are defined using special macros and can be int 1, 3, 7 or 15 colours. See my Example4 which has a 3 colour pacman with 3 frames of animation.

Cool, thanks a lot. Still on the road. I’ll let you know later tonight how it all goes :slight_smile:

Apparently Google+ is blocked at my camp, and pastebin is blocked site wide. Anyway I managed to get a hold of the code you posted and it works great! I also managed to add the sprite program, it compiles to 18k out of 28k but doesn’t seem to want to work with my nano, but when I deleted the ghosts from the pacman example it runs… slowly, but it seems to run. I forgot a USB-B cable for my uno and mega, so I cant try it on either of them at the moment.

I tried to add the debounce from adafruits buttoncycle example but failed miserably. It works, but the animations are frozen on their first frame, lol.

anyway once again, thank you so much for all of your help I really appreciate it! you have no idea how much time you freed up for me to finish up the hardware and construction that i have left to do on that helmet and now my brothers :slight_smile:

I use Bounce, there is a new version here https://github.com/thomasfredericks/Bounce-Arduino-Wiring/archive/master.zip
Glad to help and that you are making progress.

Cool, I should be able to mess around with this and come up with something. Hassled the IT guy for a USB-B cable so I should have the mega up and running tonight.

Oh and P.S. turns out my matrix is vertical, I just yesterday clued into what that actually means lol. I was under the impression that when stating Vertical or Horizontal it was referring to the matrix as a whole, not the orientation of the columns or rows… silly Aren. So yes it is in fact a vertical column matrix in a zig zag pattern.

Got the sprite implemented and sort of figured out the button press, bounce doesn’t seem to work. I also seem to have no idea how your sprite program is arranged, which should be quite apparent, lol. pastebin is blocked for me so here is another similar service but essentially the same thing.

http://pasted.co/2b15b449

I tried out the bounce on another program, and it acts a little funny, the button press dosn’t seem to always respond, and only towards the end of a loop? is this normal with bounce? or did I just do something wrong?

http://pasted.co/24f10fe0

You have used the macro B8_2BIT to define the sprite but in cSprite definition you specify the data as _1BIT and you only declare a single colour in the table so you should be using B8_1BIT.
You also use debouncer.interval(500); which is too big. The interval is how long it takes to register a press, try 10.
You read the switch state into ‘value’ but instead of then checking this variable you still do a digitalRead to increment myMode, use if (value == LOW) instead.

@Aaron_Liddiment

Alright, so I managed to figure out (mostly) the way to animate the sprite program. Then I decided to try and add a second animation and try to make it switch-able. Everything complied correctly, but the way I added the second animation was mostly just guessing. The problem now is that the code is getting a little too big for it’s britches, none of my current controllers can seem to handle it. The mega 2560 might just be altogether pooched, or I need a separate power supply. Please don’t laugh at how crude my animations are, I am sure there is a more elegant compact way to do it. I have several more animations in mind, some of them with up to 32 frames of animation. I have ordered a teensy 3.1 in the hopes that it will handle all of this tom foolery.

http://pasted.co/46814601

And for whatever reason the button is still acting strangely, it preforms a little more like how it should. it will still rapidly switch if held for a very short time, which is why I was screwing around with the time.

This works on my Teensy 3.1
http://pasted.co/b7011e2c
You will notice I have changed to switch detection to just call update() and then check for a HIGH->LOW transition.
I have also added a switch case for the loop setup of the new myMode value.
For some reason the clear() function is not working for me so I have added a manual memset8 of the LED memory.
On my Teensy using Arduino 1.6.3 memory usage is
29,964 bytes (11%) of program storage.
5,768 bytes (8%) of dynamic memory.

I think I see what is going on there, the second case function is a different set of parameters that needs to be defined elsewhere? So I was screwing around with it last night and came up with a similar conclusion with the Sprites.RemoveSprite(&SprEyes); on each case, I tried

case 1:

FastLED.clear();
Sprites.UpdateSprites();
Sprites.RemoveSprite(&SprEkg);
Sprites.AddSprite(&SprEyes);
Sprites.RenderSprites();
FastLED.show();
delay(300);

  break;
case 2:

FastLED.clear();
Sprites.UpdateSprites();
Sprites.RemoveSprite(&SprEyes);
Sprites.AddSprite(&SprEkg);
Sprites.RenderSprites();
FastLED.show();
delay(300);

and it seemed to work, probably not the most efficient.

I also think I figured out my problem with them mega 2560, cheap clone first of all, but it seems like a few digital pins are on the way out.

I noticed you had set the frame rate to 15? on mine even 1 is very slow. is there a way to increase the frame rate to be faster, or is the limiting factor the 16mhz processor? I can only assume it is faster on the 72mhz processor of the teensy 3.1

Basically the first switch case is like the loop() function for each mode and the secondswitch case is like the setup() for each mode in my revised paste.
The reason I changed the animate frames to 15 was that I removed your show() and delay() in the switch case as there was already a show() & delay() just after and I think it is neater to just perform the led array operations inside the switch. Plus the dimming/dithering works better with more frequent calls to show().
Have you tried running the code I pasted as is? Or did you just make changes to your code again? As you may have missed my removal of the show() & delay() in the sprite cases.