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.itGetting 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):
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!