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

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…

Wi-Fi module is used for Wi-Fi connection with your server and sending/receiving data with BigClown IoT platform. Wi-Fi connectivity is missing in the offer of BigClown. If you use Wi-Fi module and Wi-Fi connectivity is enough for your project, you…

Heltec Automation has introduced a new generation of its popular tracker. The Wireless Tracker V2 builds on the proven foundation of the first version, featuring the ESP32-S3, LoRa, and GNSS module, but brings several significant improvements – a stronger transmitter,…

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…

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…

Hello and welcome to the next BigClown tutorial. What can you expect in this article? I show you what are TAGs, how to upload the code to Core module through UART and also examples for measurement of temperature, humidity, atmospheric…

Trends