Just started playing around with arduino starter kit with my kid. We wrote a basic program to run different lights in an endless loop.
We then got the capacitiveSensor library and got that to work to play a sound and some other lights. He wants to put it in a pumpkin so when someone touches it the sound and new light show goes off.
So here is the question....I want the standard light display loop to play endlessly until the capacitive sensor event happens. So if I was doing this as a java or c program id spin off a thread and let the lights play and then loop in the main program until the capacitor function told me someone touched it. Then I could use a variable or something to tell it to stop the light sequence and let the sound/light event happen. Or if I still remember my EE days I'd have the capacitor function call an interrupt or something.
So how do I allow for 2 loops to happen at the same time?