Page 1 of 1

Is it possible to pigyback three programs on the Ardunio?

Posted: Thu May 08, 2014 5:46 pm
by frank_fg
:smile:
Hi!

I would like to have three programs runing on the Ardunio one after the other or one at a time, in different order.
Is that possible?

Thanks new to programing.

Frank G.

Re: Is it possible to pigyback three programs on the Ardunio

Posted: Wed May 14, 2014 6:54 pm
by jwax
Hi Frank. I don't think "playback" is the correct terminology for these things called microcontrollers.
I'm new to them too, and came here with my own question about them, but will start a new thread for that.
I believe it is possible to "stage" programs in that one sketch can have in it another sketch, and another, etc. One big sketch, or program, which contains other sketches. In other words, you can have as many "if, then" statements as you need (within reason- limited by on chip memory).

There's loads of Arduino forums and tutorials online. Best of luck to you!

John

Re: Is it possible to pigyback three programs on the Ardunio

Posted: Wed May 28, 2014 4:40 pm
by dobrien
The term is called multitasking.
Arduino has library call a Scheduler.
You can search the web site for
further information or examples.

Re: Is it possible to pigyback three programs on the Ardunio

Posted: Thu May 29, 2014 3:44 am
by jwax
Thanks dobrien, very cool!

Re: Is it possible to pigyback three programs on the Ardunio

Posted: Sun Jun 29, 2014 12:08 pm
by Rodney
Yes, just make the 2nd and 3rd program as programs that you call from the main program or, make each of the three programs as separate programs that you call from a master program. This is like using Gosubs in basic. You can make use of the "if,then" or "else" type functions to set them up to run in any manner you desire.