Getting Started with Real-Time Multi-Tasking in ARTe

Getting Started with Real-Time Multi-Tasking in ARTe © GPL3+

Free and easy-to-use Real-Time Multi-Tasking extension for Arduino IDE based on ERIKA Real-Time Operating System

  • 650 views
  • 0 comments
  • 4 respects

Components and supplies

Apps and online services

About this project

Arduino program model allows the user to develop the code using a setup() and a loop() function. This is not a limitation when you have a single activity, but it may not be enough when multiple activities have to be executed in parallel (concurrent activities).

ARTe (Arduino Real-Time extension) is an easy-to-use extension for the Arduino IDE that supports multitasking and real-time preemptive scheduling. Multitasking functionalities are provided by ERIKA enterprise RTOS.

This means that using ARTe you can easily specify and run multiple parallel loops (concurrent loops) at different rates, in addition to the single loop() cycle provided by the standard Arduino framework.

We developed ARTe to support concurrent real-time periodic activities, while maintaining the simplicity of the programming paradigm typical of the Arduino framework.

The current release of ARTe is available for Arduino IDE 1.9 Beta and works with all the Arduino supported operative systems (Windows/Mac/Linux).

At the moment, ARTe is available for the Arduino Due board, but the porting to Arduino Zero is on the way!

ARTe project is developed and maintained by an enthusiastic team in ReTiS Lab (Real-Time System Laboratory) at Scuola Superiore Sant'Anna in Pisa (Italy). If you are interested in knowing more about how ARTe works, come visit us at the project's website http://arte.retis.santannapisa.it

Getting Started with ARTe

Starting develop code with ARTe is really simple. First of all, download and install from the Arduino website the latest Arduino Beta IDE (1.9).

Now open the Arduino preference window and paste the following link in the Addition Boards Manager URLs tab and click OK button(as in figure):

http://arte.retis.santannapisa.it/package_arte_index.json

Now open Tools > Boards > Board Manager and search for "ARTe" keyword. Select the latest version and click the install button.

After installation has completed, a new architecture is available in Tools > Boards menu. Select the ARTe architecture.

We got it! Now you are able to program multitasking sketches with your Arduino!

You can define as many loop as you need at the rates you like. To be recognised as an ARTe loop, each task's name needs to start with the "loop" keyword, for example loop1(), loopa() or loop_wathever() are all acceptable names for a task.

If you are eager to figure out how powerful ARTe is, you can try the first "hello world and blinking" example using the code below.

If you like ARTe, you can find more example in the ARTe project website examples!

Code

Blinking led and Hello World with ARTeArduino
The sketches make the embedded led blink every 100 ms while serial port send "Hello ARTe" string every second
int led = 13; //built-in led
void setup() 
{
  pinMode(led,OUTPUT);
  Serial.begin(9600);
}

void loop() { //background activity, lower priority task, empty in this example
}

void loop1(100) //this loop is executed every 100 ms
{
  static int ledstatus = 1;
  if(ledstatus == 0)
  {
    digitalWrite(led,HIGH);
    ledstatus = 1;
  }
  else
  {
    digitalWrite(led,LOW);
    ledstatus = 0;
  }
}

void loop2(1000) // this loop is executed every second
{
  Serial.println("Hello ARTe!");
}
  

  

Comments

Similar projects you might like

Using FreeRTOS multi-tasking in Arduino

by Phillip Stevens

  • 125,263 views
  • 43 comments
  • 123 respects

AnduinoWiFi Getting Started

Project tutorial by Brian Carbonette

  • 2,027 views
  • 0 comments
  • 9 respects

Arduino MKR1000 Getting Started

by Dr. Charif Mahmoudi

  • 46,750 views
  • 51 comments
  • 96 respects
Add projectSign up / Login