I began working on my first LED array and sketch in July last year and it had to be shelved due to other priorities. This past weekend I dug it back out of a box and I've decided to finish it so my little daughter has a doorbell for her bedroom
The LEDs are arranged and soldered. Currently it's just programming it to my desired specs and getting it enclosed in a casing.
For reference, here is a YouTube video that's almost identical to what I'm trying to reproduce. It's a doorbell that is also an animating eye.
I've attached my most recent sketch file.
I have two questions I'm hoping to get some help with:
I added a 5th animation5() starting on line 544 - when compiled the sketch just ignores this animation and I'm not sure what I've missed.
I'd like to make the sketch stay on one animation (in this example, animation 1) until the button is pushed. When the button is pushed, a random animation (2-5) is played, and then back to animation 1. If the button isn't pressed for an extended period of time, a random animation plays, for arguments sake, every 10 minutes, then back to animation 1. I've found it's too distracting just having the animations constantly loop. Would this require re-structuring the entire sketch?
I added a 5th animation5() starting on line 544 - when compiled the sketch just ignores this animation and I'm not sure what I've missed.
At the end of animation4() you have "beginAnimation( (currentAnimation = 1) % maxAnimations);" so that switches to the first animation. The earlier animations have "beginAnimation( (currentAnimation + 1) % maxAnimations);" so that should be in animation4() now too.
Thisisliam:
2) I'd like to make the sketch stay on one animation (in this example, animation 1) until the button is pushed. When the button is pushed, a random animation (2-5) is played, and then back to animation 1. If the button isn't pressed for an extended period of time, a random animation plays, for arguments sake, every 10 minutes, then back to animation 1. I've found it's too distracting just having the animations constantly loop. Would this require re-structuring the entire sketch?
It should be sufficient to set 'currentAnimation' to the desired one and call 'beginAnimation(currentAnimation);'. Take out the code at the end of each animation that switches to the next. Put code in loop() that changes animations on button press or when it has been ten minutes (600000 milliseconds) since the last change.
Please do not post zip files - they are a security risk in Windoze, so most of us will not choose to open them.
If your code is less than 8k, post it in "code" tags as explained in the instructions. If it is greater than 8k it will be an attachment but there is no value in compressing it. Why make it more difficult to deal with?