Interrupts

I have made a Vb application to control few LED patterns. Now I want add Serial read interrupt to my code.
Help me with that.

LED_Patterns_Control_by_Buttons.ino (1.05 KB)

The first thing to do is to make your pattern function non blocking so that you get a chance to read the serial input whilst displaying the pattern. That means no delay()s and no while loops that never end

Have a look at Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.

Thank You..

Also have a look at the examples in Serial Input Basics - simple reliable non-blocking ways to receive data.

The Arduino IDE uses interrupts to move characters from the USART to the Serial Input Buffer. It should not be necessary for your code to use interrupts for serial data.

...R