Let me just start by saying, I'm a noob. I am trying to understand arduino code but my brain just isn't wrapping around it very fast. Here's the scenario : 4 separate LED's - we'll call them L1, L2, L3, and L4. 4 separate switches - we'll call them S1, S2, S3, and S4 I need L1 and L2 to flash in unison in 3 or 4 TBD different sequences to be set by toggling using a momentary switch (S1). While these are flashing in any of the above mentioned sequences, I need L3 and L4 lit to HIGH. If I press S2, I need L1 and L2 to stop performing their flashing sequence and immediately light to HIGH, and then resume the flashing sequence upon release of S2. If I press S3, I need L1 to stop it's flashing sequence and begin a different flashing sequence in unison with L3. Upon release of S3, L1 will return to the unison sequence with L2 and L3 will return to HIGH. If I press S4, I need L2 to stop it's flashing sequence and begin a different flashing sequence in unison with L4. Upon release of S4, L2 will return to the unison sequence with L1 and L4 will return to HIGH.
I have already written a program that fades L1 and L2 up and down and turns them to HIGH when S1 is pressed, while L3 and L4 remain in HIGH state. However, the addition of the S1 button press messes with the code and changes the timing of the fade and if I make the fade timing too short, the HIGH state of L1 and L2 flicker while S1 is pressed.
Any help would be appreciated.