Coder Social home page Coder Social logo

techpaul / scheduler Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 156 KB

Arduino Simple Co-operative Scheduler

License: GNU Lesser General Public License v2.1

C++ 85.41% C 14.59%
statistics hardware schedule arduino multitasking cooperative-multitasking arduino-library

scheduler's Introduction

Arduino Simple Co-operative Scheduler

Scheduler originally tested on DUE R3 hardware and V1.6.7 Arduino IDE

Simple Co-operative scheduling module to add to sketch, for COMPILE time task list creation. This is because all tasks are known at compile time and new tasks cannot be loaded whilst running, tasks can be stopped and started so management of tasks is simpler.

All tasks can run as state machines using task status from task scheduler.

Has ability to read list of tasks and last execution status along with statistics to aid debugging. Statistics and list include last execution time in us as well as details on overdue scheduling or longest ever task run time.

Many methods to start and change frequency and other aspects of task management. Tasks can stop themselves and change frequency, other helper functions, tasks and interrupts.

Extra folder contains documentation also comments in code to assist.

Only file that needs editing is Tasklist.h to give the list of top level functions for each task and if you want faster or slower task loop time (the time between each processing pass of the task list).

Example

Example folder contains an example performing multiple tasks and some on demand so they stay stopped until started on demand.

Uses hardware of

2 x LEDs (wired from GPIO to ground via resistor for 1 = ON
20 x 4 LCD (PWM available to drive backlight brightness
Analogue pot to determine brightness for backlight (High for ON)
LED PWM output for driving optional LED Brightness but LOW for ON
FOUR switches to make requests to start tasks
Serial port (115,200 baud) Serial0 or Programming Port

See file IO.h for pin assignments

Main tasks

  1. Continuous read pot to set brightness
  2. Continuous checksum and area of RAM
  3. Continuous flash One LED at 4Hz
  4. On demand (from a switch) flash a second LED at 10Hz for 2 seconds
  5. On demand (from a switch) display last checksum on LCD
  6. On demand (from a switch) send copy of last pass task list details to serial
  7. On demand (from a switch) send copy of last pass statistics details to serial

Installation

Three files to add to sketch ONLY one to edit to match your sketch.

Schedule.cpp
Schedule.h
Tasklist.h

Author

Paul Carpenter
P C Services
[email protected]
http://www.pcserviceselectronics.co.uk

February 2016

scheduler's People

Contributors

techpaul avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

luisseo01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.