Pages: [1]   Go Down
Author Topic: Simple Scheduler  (Read 698 times)
0 Members and 1 Guest are viewing this topic.
NZ
Offline Offline
Jr. Member
**
Karma: 1
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to do a simple  scheduler like below.
I'm new to Arduino and C but done some assembly and Forth.

I have looked through the help files but haven't found anything yet.
I'm not ready for a fully blown RTOS yet, just something simple for now.

Any suggestions ?
fiddler
//+++++++++++++

void Main();
  GoTo  Task_1;
  GoTo  Task_2;
  GoTo  Task_3;
  GoTo  Main;
 
Task_1;
  return

Task_2;
  return

Task_3;
  return   
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27069
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
void setup(){
}

void loop(){
function1();
function2();
function3();
}

function1(){
//code
}
function2(){
//code
}
function3(){
//code
}
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Cave
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Look at Protothreads.
Logged

electrotormentor.blogspot.com

NZ
Offline Offline
Jr. Member
**
Karma: 1
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool

Thanks

fiddler
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You might also want to look at Metro:
http://www.arduino.cc/playground/Code/Metro
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3481
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Another option might be the event fuse library http://www.arduino.cc/playground/Code/EventFuse.
Logged

Check out my experiments http://blog.blinkenlight.net

Pages: [1]   Go Up
Jump to: