A New version of “Tasker for Arduino”

This is a cooperative scheduler for running multiple tasks on Arduino. The tasks are called automatically at specified times for specified number of times. This frees your program from timing logic and makes your Arduino look like it’s doing several things at once.

Cooperative means that the tasks you create need to behave nicely – to co-operate together by running for a short time only, otherwise it will not work well. Scheduler means that each task has its own schedule so Tasker knows when the tasks are to be started (in what time since now) and how many times they should be invoked (only once, X times or forever).

The “co-operation” is best achieved by creating small, short running tasks (functions). Basically wherever you’d need to include the infamous delay() call in your Arduino program that’s the place where you actually want to break the code flow, split the source code into separate functions and let Tasker run them as separate tasks.

There are many similar libraries for the same purpose available on the Internet but they are either buggy (don’t handle timer overflow) or too complicated, cumbersome to use, unnecessary object-oriented or otherwise hard to understand and follow.

This Tasker library is carefully designed to be extremely simple yet very powerful. It has short, clean API and clear implementation that fits on a single page and can be reviewed easily. Best of all, its API is intentionally similar to JavaScript’s timer functions so HTML/JavaScript programmers will feel right at home. For the unfamiliar with JavaScript there’s a short example code included that illustrates the whole API and its best usage.

Whole github project and description is available on https://github.com/joysfera/arduino-tasker/blob/master/README.md

Share the article:
Tags:
Show your
Maker soul!
Buy a T-Shirt
Coffee for Chiptron
Give a boost to the next article

Related Articles

Notice by administrator: A few STM32 development boards (e.g. STM32L4 and IoT development board, STM32F723 and STMod+ connector) as well as Microchip development boards contain also PMOD connector List of Microchip Development boards with PMOD connector (selected) DM240001-2, DM160228, DM240001-3…

Maybe you read about a new board by STMicroelectronics and Arduino.org – Arduino STAR OTTO Arduino compatible board with STM32F469 microcontroller. In this article I describe you how to set your laptop, arduino IDE and how to upload your code…

Arduino IDE may not be comfortable for all of makers. Is a lot alternatives to Arduino IDE like Visual Studio, Codebender a another. I think that Eclipse has one of the best editor for writing of codes. Arduino IDE has…

Arduino is very popular platform with support from huge community. You can buy a lot of Arduino (compatible) boards – original Arduino, clone of Arduino with the same microcontroller (ATmega328, SAMD21) or different microcontroller (ESP32, ESP8266). Arduino board with STM32…

AVR, ATMega, ATTiny, PIC, Arduino… these are very searching words in google and I asked myself “Why?”. Yes, AVR by Atmel or PIC by Microchip family is popular, but we can program better (modern, faster, more low-power, more peripherals) microcontrollers…