Is it possible to pigyback three programs on the Ardunio?

Electronics Computer Programming Q&A
Post Reply
frank_fg
Posts: 23
Joined: Tue Apr 29, 2008 9:07 am
Contact:

Is it possible to pigyback three programs on the Ardunio?

Post by frank_fg » Thu May 08, 2014 5:46 pm

: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.

User avatar
jwax
Posts: 2133
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

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

Post by jwax » Wed May 14, 2014 6:54 pm

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

dobrien
Posts: 37
Joined: Thu May 15, 2008 6:01 am
Contact:

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

Post by dobrien » Wed May 28, 2014 4:40 pm

The term is called multitasking.
Arduino has library call a Scheduler.
You can search the web site for
further information or examples.

User avatar
jwax
Posts: 2133
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

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

Post by jwax » Thu May 29, 2014 3:44 am

Thanks dobrien, very cool!

Rodney
Posts: 162
Joined: Sat Aug 31, 2002 1:01 am
Location: Titusville, FL USA
Contact:

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

Post by Rodney » Sun Jun 29, 2014 12:08 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest