GithubHelp home page GithubHelp logo

las's Introduction

LAS

Lukacho's Amazing Scheduler! (for Arduino)

LAS is a very simple and easy to use cooperative scheduler for any board that can be programmed using Arduino.h and Arduino's flavour of C++.

Depends on arduLogger

What can LAS do?

LAS can:

  • create basic, function or method based, Tasks with a variety of parameters
  • now also create tasks from contextual objects extending the "Callable" class
  • execute timed code
  • execute repeated code
  • allow you to manipulate Tasks from within their included functions for maximum control
  • have an accuracy of less than a ms while doing so

Most importantly, LAS can easily help you get rid of the pitfalls that can arise from using delays or basic millis() based timing when combined with recurring tasks.

Basic instructions

all LAS functions and fields can be accessed through its namespace. LAS is fully accessible and allows you to manipulate most of its parts at runtime.

  • LAS::scheduleFunction: schedule a paramterless void function as an internal task with a variety of timing and repeat options

  • LAS::scheduleIn: A handy shortcut for simple scheduling of a function in x milliseconds

  • LAS::scheduleRepeated: shortcut for creating a simple repeated task

  • LAS::schedulerInit: Start LAS. Initialize LAS. Only needs a logger right now. You can pass an instance of arduLogger (or a wrapper for another logger following arduLoggers definition) or let LAS create one internally, if you prefer to use another logger for the rest of your project.

  • LAS::schedulerStart: actually starts LAS after successful initialization. Place first schedulings inbetween init and start.

  • ALL OF THE ABOVE FUNCTIONS ARE NOW AVAILABLE TO BE USED WITH CALLABLES AS WELL.

  • Simply derive a class from "Callable" and override the run method with your function, then pass an object as previously done as a pointer. You can also include environment variables or return pointers for your void function.

  • new: there's an overridable "onFinish" method now. No "onCreate" for now though, as actually running it on creation seems kind of pointless, and I don't really want to add another Task field to count ececutions done.

What to expect in the future:

  • The abovementioned "onCreate" method will probably come sometime in the future
  • also I'm planning to optimize LAS a bit by cutting down on unused fields on non-repeating tasks.

Why did I even make this and not just use an existing project?

mostly for fun! This project really helped me in understanding some of C++'s low level concepts better. Also I prefer working with lightweight implementations I fully understand instead of immediately adapting an existing framework with lots of overhead.

This is also actively used for an Arduino based robot project (still very WIP): See Philipp Räuchle for more.

las's People

Contributors

lukacholombardi avatar

Stargazers

Lxini_G avatar  avatar

Watchers

 avatar

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.