All Projects → vishnumaiea → ptScheduler

vishnumaiea / ptScheduler

Licence: MIT license
Pretty tiny Scheduler or ptScheduler is an Arduino library for writing non-blocking periodic tasks easily.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to ptScheduler

Marl
A hybrid thread / fiber task scheduler written in C++ 11
Stars: ✭ 1,078 (+7600%)
Mutual labels:  scheduler, tasks, task-scheduler
Deepsleepscheduler
DeepSleepScheduler is a lightweight, cooperative task scheduler library with configurable sleep and task supervision.
Stars: ✭ 59 (+321.43%)
Mutual labels:  avr, scheduler, task-scheduler
Concurrencpp
Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all
Stars: ✭ 340 (+2328.57%)
Mutual labels:  scheduler, tasks, task-scheduler
Weave
A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead
Stars: ✭ 305 (+2078.57%)
Mutual labels:  scheduler, task-scheduler
CoopThreads
Lightweight, platform agnostic, stackful cooperative threads library.
Stars: ✭ 18 (+28.57%)
Mutual labels:  scheduler, multitasking
josk
🏃🤖 Scheduler and manager for jobs and tasks in node.js on multi-server and clusters setup
Stars: ✭ 27 (+92.86%)
Mutual labels:  scheduler, tasks
gronx
Lightweight, fast and dependency-free Cron expression parser (due checker), task scheduler and/or daemon for Golang (tested on v1.13 and above) and standalone usage
Stars: ✭ 206 (+1371.43%)
Mutual labels:  scheduler, task-scheduler
Db Scheduler
Persistent cluster-friendly scheduler for Java
Stars: ✭ 352 (+2414.29%)
Mutual labels:  scheduler, task-scheduler
Openmangosteen
Devops定时调用http接口,定时执行SSH命令的WEB定时任务工具。
Stars: ✭ 41 (+192.86%)
Mutual labels:  scheduler, task-scheduler
Cronscheduler.aspnetcore
Cron Scheduler for AspNetCore 2.x/3.x or DotNetCore 2.x/3.x Self-hosted
Stars: ✭ 100 (+614.29%)
Mutual labels:  scheduler, task-scheduler
Frame Scheduling
Asynchronous non-blocking running many tasks in JavaScript. Demo https://codesandbox.io/s/admiring-ride-jdoq0
Stars: ✭ 64 (+357.14%)
Mutual labels:  scheduler, tasks
Flask Rq2
A Flask extension for RQ.
Stars: ✭ 176 (+1157.14%)
Mutual labels:  scheduler, tasks
scheduler
Task Scheduler for Laravel applications. UI from scratch
Stars: ✭ 18 (+28.57%)
Mutual labels:  scheduler, task-scheduler
King.Service
Task scheduling for .NET
Stars: ✭ 34 (+142.86%)
Mutual labels:  scheduler, task-scheduler
Swiftqueue
Job Scheduler for IOS with Concurrent run, failure/retry, persistence, repeat, delay and more
Stars: ✭ 276 (+1871.43%)
Mutual labels:  scheduler, delay
outspline
Extensible outliner and personal time organizer to manage todo lists, schedule tasks, remind events.
Stars: ✭ 41 (+192.86%)
Mutual labels:  scheduler, task-scheduler
angular-gantt-schedule-timeline-calendar-example
Angular gantt-schedule-timeline-calendar usage example
Stars: ✭ 15 (+7.14%)
Mutual labels:  scheduler, tasks
joobq
JoobQ is a fast, efficient asynchronous reliable job queue and job scheduler library processing. Jobs are submitted to a job queue, where they reside until they are able to be scheduled to run in a computing environment.
Stars: ✭ 26 (+85.71%)
Mutual labels:  scheduler, tasks
Rq Scheduler
A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
Stars: ✭ 1,095 (+7721.43%)
Mutual labels:  scheduler, task-scheduler
ESP8266TimerInterrupt
This library enables you to use Interrupt from Hardware Timers on an ESP8266-based board. It now supports 16 ISR-based timers, while consuming only 1 hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tas…
Stars: ✭ 85 (+507.14%)
Mutual labels:  delay, millis

ptScheduler

Pretty tiny Scheduler

Pretty tiny Scheduler or ptScheduler is a non-preemptive task scheduler and timing library for Arduino. It helps you write non-blocking, periodic tasks easily without using ordinary delay routines or using millis() or micros() functions. Delay routines can prevent other parts of your code from running until the delay is exhausted. Using millis() function in your code can make it harder to understand and manage. ptScheduler solves these problems.

ptScheduler acts as a wrapper for millis() or micros() based logic used for timing of tasks. Under the hood, ptScheduler uses the native micros() implementation of Arduino. The micros() function is a hardware timer-based ISR that increments a global counter variable (unsigned integer) every microsecond. This function is available on all microcontrollers that support the Arduino framework. ptScheduler was using millis() function previously, but the new micros() provides granular timing in microseconds compared to milliseconds.

When you create a new ptScheduler task, you can specify the time intervals and execution modes. There are two execution modes - ONESHOT and SPANNING. Oneshot task is executed only once every time an interval is elapsed. Spanning task on the other hand remains active during the span of an interval.

All class member variables and functions are public and therefore give you full control over your tasks, allowing dynamically changing the behavior of the task. To run a task, just enclose the call() function inside any conditional statements, either inside your infinite loop or inside a function. Every time you invoke the call() function, it checks if the elapsed time is larger than the preset interval. If yes, it will return true and cause the code under the conditional block to be executed.

ptScheduler is good mainly for control applications that require periodic polling of sensors, GPIOs, and other IO devices. ptScheduler tasks can coexist with preemptive tasks such as FreeRTOS tasks.

Hello World

Here is the basic Hello World example.

#include "ptScheduler.h"

//create tasks
ptScheduler sayHello = ptScheduler(1000000); //time in microseconds

//setup function runs once
void setup() {
  Serial.begin(9600);
}

//infinite loop
void loop() {
  if (sayHello.call()) {  //executed every second
    Serial.println("Hello World");
  }

  //add other tasks and non-blocking code here
}

Tutorial

Complete tutorial can be found at CIRCUITSTATE

Documentation

See the reference of all available functions and variables in the Documentation page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].