Multiple Programs that need to run

Hi Guys
I am really new to programming but I can see that the Arduino can make few of my ideas come to life.
I have played around with programming some led strips and got that right but for only 1 program.
Question...... Can I run more than 1 program. The project I am currently working requires 1 set of LEDS to be Red and then flash when a button is activated, at the same time I need a few LEDs to be on a static colour and when the same button is pressed the LEDs start to run a rainbow sequence and then lastly a sound byte needs to play out when the same button is pressed.

Your help would be greatly appreciated in learning how to make this possible.

No, most arduinos are single-core controllers and can run only one program in the time.

You can run only one program in the time, but you can perform more than one task in the single code.

Ok, so I think I could make that work for my project.
So as I understand it then I can write code to flash lights and play the sound byte all in the same code, effectively giving me the result I am looking for.

Yes, provided you program the sketch appropriately.
Avoid delay() and other Arduino functions that will stall the CPU. You can read about good code style:

Now for two at once | Multi-tasking the Arduino - Part 1 | Adafruit Learning System

Thanks, on with the learning I go

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.