All Projects → mikaelpatel → Arduino Scheduler

mikaelpatel / Arduino Scheduler

Portable Cooperative Multi-tasking Scheduler for Arduino

Projects that are alternatives of or similar to Arduino Scheduler

Ramp
Arduino Interpolation Library
Stars: ✭ 72 (-43.31%)
Mutual labels:  arduino, arduino-library
Fpm
Arduino library for the R30x/ZFMxx/FPMxx optical fingerprint sensors
Stars: ✭ 79 (-37.8%)
Mutual labels:  arduino, arduino-library
Aunit
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test. Used with AUniter or EpoxyDuino for continuous builds.
Stars: ✭ 73 (-42.52%)
Mutual labels:  arduino, arduino-library
Micronmea
A compact Arduino library to parse NMEA sentences.
Stars: ✭ 66 (-48.03%)
Mutual labels:  arduino, arduino-library
Simpledht
Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
Stars: ✭ 111 (-12.6%)
Mutual labels:  arduino, arduino-library
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (-47.24%)
Mutual labels:  arduino, arduino-library
Tft espi
Arduino and PlatformIO IDE compatible TFT library optimised for the STM32, ESP8266 and ESP32 that supports different driver chips
Stars: ✭ 1,215 (+856.69%)
Mutual labels:  arduino, arduino-library
Tm16xx
Arduino TM16xx library for LED & KEY and LED Matrix modules based on TM1638, TM1637, TM1640 and similar chips. Simply use print() on 7-segment and use Adafruit GFX on matrix.
Stars: ✭ 61 (-51.97%)
Mutual labels:  arduino, arduino-library
Button2
Arduino Library to simplify working with buttons. It allows you to use callback functions to track single, double, triple and long clicks. It also takes care of debouncing.
Stars: ✭ 109 (-14.17%)
Mutual labels:  arduino, arduino-library
Noodle Synth
A User-friendly Arduino/Teensy/ESP8266 Library to play MIDI files with infinite polyphonic notes with full control over volume, pitch, and . . . music. No shields needed(Just a speaker).
Stars: ✭ 99 (-22.05%)
Mutual labels:  arduino, arduino-library
Dmxusb
DMXUSB emulates an ENTTEC-compatible DMXKing USB to DMX serial device with one, two, or n universes.
Stars: ✭ 66 (-48.03%)
Mutual labels:  arduino, arduino-library
Lora Serialization
LoraWAN serialization/deserialization library for The Things Network
Stars: ✭ 120 (-5.51%)
Mutual labels:  arduino, arduino-library
Dmxserial2
An Arduino library for sending and receiving DMX RDM packets.
Stars: ✭ 65 (-48.82%)
Mutual labels:  arduino, arduino-library
Liquidcrystal pcf8574
A library for driving LiquidCrystal displays (LCD) by using the I2C bus and an PCF8574 I2C adapter.
Stars: ✭ 67 (-47.24%)
Mutual labels:  arduino, arduino-library
Ws2812fx
WS2812 FX Library for Arduino and ESP8266
Stars: ✭ 1,113 (+776.38%)
Mutual labels:  arduino, arduino-library
Ultrasonic
Minimalist library for Ultrasonic Module HC-SR04, PING))) and Seeed SEN136B5B to Arduino
Stars: ✭ 77 (-39.37%)
Mutual labels:  arduino, arduino-library
Gem
Good Enough Menu for Arduino
Stars: ✭ 54 (-57.48%)
Mutual labels:  arduino, arduino-library
Segacontroller
Arduino library to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.
Stars: ✭ 55 (-56.69%)
Mutual labels:  arduino, arduino-library
Beelan Lorawan
A LoRaWAN library for compatible arduino board
Stars: ✭ 87 (-31.5%)
Mutual labels:  arduino, arduino-library
Mpu6050 tockn
Arduino library for easy communication with MPU6050
Stars: ✭ 119 (-6.3%)
Mutual labels:  arduino, arduino-library

Arduino-Scheduler

This library implements an extended sub-set of the Arduino Scheduler class. Multiple loop() functions, tasks, may be started and run in a cooperative multi-tasking style. The tasks are run until they call yield() or delay(). The Arduino yield() function is replaced by an implementation in the library that allows context switching.

Tasks should be viewed as static and continuous. This implementation does not allocate tasks on the heap. They are allocated on the normal stack and linked into a cyclic run queue. One-shot tasks are not supported. Instead the task start function is extended with a setup function reference. Tasks are started with:

Scheduler.start(taskSetup, taskLoop [,taskStackSize]).

The tasks will start execution when the main task yields. The taskSetup is called first and once by the task followed by repeated calls to taskLoop. This works just as the Arduino setup() and loop() functions. There is also an optional parameter, taskStackSize. The default value depends on the architecture (128 bytes for AVR and 1024 bytes for SAM/SAMD/Teensy 3.X).

Scheduler.startLoop(taskLoop [,taskStackSize]).

A short hand version of start() is available when the taskSetup is NULL.

The Scheduler is a single-ton and the library creates the single instance.

This library also includes support for task synchronization and communication; Semaphores, Queues and Channels. There is also built-in support for checking the amount of stack head room, i.e. untouched stack space.

int bytes = Scheduler.stack();

The Scheduler member function stack() will scan the running task stack and determine the minimum amount of remaining stack during the execution so far. The example sketch SchedulerBlinkMax shows how this can be used.

Install

Download and unzip the Arduino-Scheduler library into your sketchbook libraries directory. Rename from Arduino-Scheduler-master to Arduino-Scheduler.

The Scheduler library and examples should be found in the Arduino IDE File>Examples menu.

Performance

There are several benchmark sketches in the examples directory. Below are some of the results.

Context Switch

Board us cycles
Arduino Mega 2560 (16 MHz) 12.64 203
Arduino Uno, Nano, Pro-Mini, etc (16 MHz) 11.00 176
Sparkfun SAMD21 (48 MHz) 2.60 125
Arduino Due (84 MHz) 1.36 115
Teensy 3.1 (72 MHz) 1.10 80
Teensy 3.6 (180 MHz) 0.43 78
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].