Ws2811b makeing mode's

Hello im kinda new to arduino. I need some help for an interrupt i think. my golas is to make the ws2811b leds make various scene and animations. with the help of an butten.

My code so far.

sketch_jul23a.ino (1.24 KB)

I don't think you need any interrupt. Your problem is due to the 5 seconds delay which prevents to read the button. Do you really need this delay?

Right, first things first.

Please go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to mark up the code (but it needs to be the complete code) as such so we can examine it conveniently and accurately. Please do not post a ".ino" file as an attachment - that would mean that you are expecting people to actually load it to their IDE to look at it and that is extra unnecessary labour. In fact, attachments do not always show properly on different operating systems.

If you do not mark it up as code, the code you post could well be garbled and is certainly anything but easy to read.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

And - before you post any code, use "Auto Format" in the Tools menu of the IDE to properly present the code.

Try and avoid unnecessary white space (blank lines). You should only use these to separate functional blocks of code.

Until you reply and demonstrate that you understand these points that have been made so far, it is of dubious value to work with the code, and I suspect other people feel the same way.

You use the term "interrupt". I suspect you have heard of "interrupts" in microprocessors. Whenever I see a post which includes the word "interrupt", I instinctively cringe.

Seems you - and many other "newbies" of course - do not understand what an interrupt is in a microprocessor.

An interrupt is a mechanism for performing a task that can be performed virtually instantaneously, that must be performed virtually immediately, and that is not in itself intended to affect the flow of the main program (or delay it) in any way. Servicing a pushbutton essentially tends to fail all three criteria. The terms "instantaneously" and "immediately" are here defined in microprocessor, not human context, that is in terms of microseconds.

You wish to "interrupt" the operation of a particular part of your code. This is quite different to the above; to do this, you must insert decisions into the code where you wish it to be "interrupted".